# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1520854655 -3600
# Node ID 9f80c08cdae91a3dd01b90d521bb66b1f208559b
# Parent  98a0edb4bb5a2be83a636985bba6531f5ce64f6d
Lua API: Add onSkipTurn callback, called when hog skips

diff -r 98a0edb4bb5a -r 9f80c08cdae9 ChangeLog.txt
--- a/ChangeLog.txt	Mon Mar 12 12:27:13 2018 +0100
+++ b/ChangeLog.txt	Mon Mar 12 12:37:35 2018 +0100
@@ -106,6 +106,7 @@
  + New call: SkipTurn(): Force current hedgehog to skip turn
  + New param: PlaySound accepts 3rd parameter for voices: instaVoice: If true, sound plays instantly instead of being queued
  + New callback: onEndTurn(): Called at the end of a turn (when gears have settled)
+ + New callback: onSkipTurn(): Called when a hog skips turn
  + New hedgehog effect: heArtillery: Per-hedgehog artillery mode (can't walk). Values: 1 = permanently active. 2 = temporarily active (sniper rifle). 0 = not active
  * AddAmmo now automatically unselects weapon if it would remove current ammo from current hedgehog
  * Fix call: SetWeapon(amNothing) now unselects weapon
diff -r 98a0edb4bb5a -r 9f80c08cdae9 hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Mon Mar 12 12:27:13 2018 +0100
+++ b/hedgewars/uGears.pas	Mon Mar 12 12:37:35 2018 +0100
@@ -1119,7 +1119,8 @@
 if not isExternalSource then
     SendIPC(_S',');
 uStats.Skipped;
-skipFlag:= true
+skipFlag:= true;
+ScriptCall('onSkipTurn');
 end;
 
 procedure chHogSay(var s: shortstring);