Fix attack direction when perform somersault
authorunc0rr
Fri, 02 May 2008 09:23:51 +0000
changeset 900 5224ac938442
parent 899 36f91881e83f
child 901 2f5ce9a584f9
Fix attack direction when perform somersault
hedgewars/HHHandlers.inc
--- a/hedgewars/HHHandlers.inc	Thu May 01 16:00:23 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Fri May 02 09:23:51 2008 +0000
@@ -96,7 +96,9 @@
            PlaySound(sndThrowRelease, false);
            end;
         xx:= SignAs(AngleSin(Angle), dX);
-        yy:= -AngleCos(Angle); 
+        yy:= -AngleCos(Angle);
+
+        if ((Gear^.State and gstHHHJump) <> 0) then xx:= - xx;
              case Ammo^[CurSlot, CurAmmo].AmmoType of
                       amGrenade: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Bomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
                   amClusterBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtClusterBomb,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);