hedgewars/uGearsHedgehog.pas
changeset 12291 b4dde7035fe2
parent 12209 0a7d7256d3d8
child 12298 6383323fdd2c
--- a/hedgewars/uGearsHedgehog.pas	Wed Apr 19 08:35:31 2017 -0400
+++ b/hedgewars/uGearsHedgehog.pas	Wed Apr 19 17:50:31 2017 +0200
@@ -1232,14 +1232,14 @@
 else if not isInMultiShoot then
     AllInactive:= false;
 
-if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) then
+if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) or (LuaEndTurnRequested = true) then
     begin
     if (Hedgehog^.CurAmmoType = amKnife) then
        LoadHedgehogHat(Hedgehog^, Hedgehog^.Hat);
     if TagTurnTimeLeft = 0 then
         TagTurnTimeLeft:= TurnTimeLeft;
     TurnTimeLeft:= 0;
-    if ((HHGear^.State and gstAttacked) = 0) and (HHGear^.Damage = 0) then
+    if ((HHGear^.State and gstAttacked) = 0) and (HHGear^.Damage = 0) and (LuaNoEndTurnTaunts = false) then
         begin
         AddVoice(sndBoring, Hedgehog^.Team^.voicepack);
         if (GameFlags and gfInfAttack = 0) then
@@ -1251,6 +1251,8 @@
     isCursorVisible:= false;
     HHGear^.State:= HHGear^.State and (not (gstHHDriven or gstAnimation or gstAttacking));
     AttackBar:= 0;
+    LuaEndTurnRequested:= false;
+    LuaNoEndTurnTaunts:= false;
     if HHGear^.Damage > 0 then
         HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump));
     exit