Fix some bugs with dropping from parachute
authorunc0rr
Wed, 14 May 2008 14:13:18 +0000
changeset 931 ab4d98858a40
parent 930 3f61bd3b08fd
child 932 3c5b884475da
Fix some bugs with dropping from parachute
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/hwengine.dpr
hedgewars/uConsts.pas
--- a/hedgewars/GSHandlers.inc	Tue May 13 20:00:48 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Wed May 14 14:13:18 2008 +0000
@@ -1135,7 +1135,6 @@
 
 procedure doStepParachute(Gear: PGear);
 var HHGear: PGear;
-    Timer: Longword;
 begin
 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
 
@@ -1144,7 +1143,7 @@
 OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
 ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
 
-HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked);
+HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked or gstMoving);
 HHGear^.Message:= HHGear^.Message and not gm_Attack;
 
 Gear^.doStep:= @doStepParachuteWork;
--- a/hedgewars/HHHandlers.inc	Tue May 13 20:00:48 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Wed May 14 14:13:18 2008 +0000
@@ -476,9 +476,13 @@
 		Attack(Gear) // should be before others to avoid desync with '/put' msg and changing weapon msgs
 	else
 else with PHedgehog(Gear^.Hedgehog)^ do
-	 if ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) <> 0)
+	 if ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) <> 0) 
 		and ((Gear^.Message and gm_LJump) <> 0)
-		and (((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_AltUse) <> 0) then Attack(Gear);
+		and (((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_AltUse) <> 0) then
+		begin
+		Gear^.Message:= Gear^.Message and not gm_LJump;
+		Attack(Gear)
+		end;
 
 if (CurAmmoGear = nil)
 	or ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) <> 0) then
--- a/hedgewars/hwengine.dpr	Tue May 13 20:00:48 2008 +0000
+++ b/hedgewars/hwengine.dpr	Wed May 14 14:13:18 2008 +0000
@@ -66,7 +66,7 @@
 ////////////////////////////////
 procedure DoTimer(Lag: LongInt);
 const MusicTimerTicks: Longword = 0;
-var s: string;
+//var s: string;
 begin
 inc(RealTicks, Lag);
 
--- a/hedgewars/uConsts.pas	Tue May 13 20:00:48 2008 +0000
+++ b/hedgewars/uConsts.pas	Wed May 14 14:13:18 2008 +0000
@@ -592,6 +592,7 @@
                                    Probability: 100;
                                    NumberInCase: 1;
                                    Ammo: (Propz: ammoprop_NoCrosshair or
+                                                 ammoprop_AttackInMove or
                                                  ammoprop_DontHold or
                                                  ammoprop_AltUse;
                                           Count: 2;