fix hedgehog on parachute facing in wrong direction if parachute opens during double-jump
authorsheepluva
Mon, 09 Nov 2015 19:21:40 +0100
changeset 11342 aa3f886c6298
parent 11341 e6e748d021d0
child 11343 0bff27d8d18f
fix hedgehog on parachute facing in wrong direction if parachute opens during double-jump
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Mon Nov 09 21:09:51 2015 +0300
+++ b/ChangeLog.txt	Mon Nov 09 19:21:40 2015 +0100
@@ -5,6 +5,7 @@
  * Hammer damage is now rounded down. This means it will cause NO DAMAGE to a hedgehog with less than 3 hp.
  * Fixed bee not being affected by wrap world edge while still being thrown
  * Fixed turn not ending when sticky mine was trapped on rubberband
+ * Various other fixes
 
 0.9.21 -> 0.9.22
  + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs)
--- a/hedgewars/uGearsHandlersMess.pas	Mon Nov 09 21:09:51 2015 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Nov 09 19:21:40 2015 +0100
@@ -2650,7 +2650,11 @@
 
     AfterAttack;
 
-    HHGear^.State := HHGear^.State and (not (gstAttacking or gstAttacked or gstMoving));
+    // make sure hog doesn't end up facing in wrong direction due to high jump
+    if (HHGear^.State and gstHHHJump) <> 0 then
+        HHGear^.dX.isNegative := (not HHGear^.dX.isNegative);
+
+    HHGear^.State := HHGear^.State and (not (gstAttacking or gstAttacked or gstMoving or gstHHJumping or gstHHHJump));
     HHGear^.Message := HHGear^.Message and (not gmAttack);
 
     Gear^.doStep := @doStepParachuteWork;