--- a/ChangeLog.txt Thu Feb 08 15:44:08 2018 +0100
+++ b/ChangeLog.txt Thu Feb 08 18:10:39 2018 +0100
@@ -29,6 +29,7 @@
Lua API:
+ New call: WriteLnToChat(string): Add a line in the chat
+ + New callback: onEndTurn(): Called at the end of a turn (when gears have settled)
* Fix call: SetWeapon(amNothing) now unselects weapon
* Fix global: TotalRounds was stuck at -1 for several turns
--- a/hedgewars/uGears.pas Thu Feb 08 15:44:08 2018 +0100
+++ b/hedgewars/uGears.pas Thu Feb 08 18:10:39 2018 +0100
@@ -62,7 +62,7 @@
var delay: LongWord;
delay2: LongWord;
- step: (stDelay, stChDmg, stSweep, stTurnReact,
+ step: (stInit, stDelay, stChDmg, stSweep, stTurnReact,
stAfterDelay, stChWin, stWater, stChWin2, stHealth,
stSpawn, stNTurn);
NewTurnTick: LongWord;
@@ -253,6 +253,11 @@
if AllInactive then
case step of
+ stInit:
+ begin
+ ScriptCall('onEndTurn');
+ inc(step)
+ end;
stDelay:
begin
if delay = 0 then