Fix multiple timeboxes spawning when hog moves before timebox arrived
authorWuzzy <Wuzzy2@mail.ru>
Thu, 18 Jul 2019 18:45:30 +0200
changeset 15253 000d3262244c
parent 15252 515a4a317e52
child 15254 ebb86ed1b785
Fix multiple timeboxes spawning when hog moves before timebox arrived
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Jul 18 03:39:58 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Jul 18 18:45:30 2019 +0200
@@ -6330,7 +6330,12 @@
         begin
         if (HH^.Gear^.Damage <> 0) or (HH^.Gear^.Health = 0) or
         ((HH^.Gear^.State and (gstMoving or gstHHDeath or gstHHGone or gstDrowning)) <> 0) then
+            begin
             Gear^.Tag:= 1;
+            HH^.Gear^.State:= HH^.Gear^.State and (not gstAttacking);
+            HH^.Gear^.Message:= HH^.Gear^.Message and (not gmAttack);
+            AfterAttack;
+            end;
         end
     else if HH^.GearHidden = nil then
         Gear^.Tag:= 1;