Fix hog attack code always destroying TargetPoint, even if no attack occurred. Fixes bug 265
authorWuzzy <Wuzzy2@mail.ru>
Sun, 02 Sep 2018 00:07:33 +0200
changeset 13738 2ac3658a2a13
parent 13737 8092b54ba19d
child 13739 bbea77a8dff9
Fix hog attack code always destroying TargetPoint, even if no attack occurred. Fixes bug #265
ChangeLog.txt
hedgewars/uGearsHedgehog.pas
--- a/ChangeLog.txt	Sat Sep 01 23:03:56 2018 +0200
+++ b/ChangeLog.txt	Sun Sep 02 00:07:33 2018 +0200
@@ -24,6 +24,7 @@
  * Fix invisible projectile timer, attack bar, target on other side of wrap world edge
  * Fix attack bar drawn over GUI elements
  * Fix hog being unable to walk after using sniper rifle without firing both shots
+ * Fix bee weapon becoming unusable when hitting attack key in mid-air
  * Fix video recorder not working when game audio was disabled
  * Fix cursor teleporting to center after leaving game with a video recording
  * Fix teleport tooltip claiming it doesn't end turn in hog placing phase with inf. attack
--- a/hedgewars/uGearsHedgehog.pas	Sat Sep 01 23:03:56 2018 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Sun Sep 02 00:07:33 2018 +0200
@@ -596,15 +596,14 @@
                 if (not CurrentTeam^.ExtDriven) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0) then
                     SendIPC(_S'a');
                 AfterAttack;
-                end
+                end;
+            TargetPoint.X := NoPointX;
             end
         else
             Message:= Message and (not gmAttack);
 
     ScriptCall('onHogAttack', ord(usedAmmoType));
     end; // of with Gear^, Gear^.Hedgehog^ do
-
-    TargetPoint.X := NoPointX;
 end;
 
 procedure AfterAttack;