make punch usable with no gravity lua
authornemo
Mon, 23 Dec 2013 00:52:02 -0500
changeset 9824 136e0708eda2
parent 9823 31c5f7e65259
child 9825 de0da12b7d0e
make punch usable with no gravity lua
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsList.pas
--- a/hedgewars/uGearsHandlersMess.pas	Mon Dec 23 03:15:39 2013 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Dec 23 00:52:02 2013 -0500
@@ -2293,7 +2293,8 @@
         end;
 
     HHGear^.dY := HHGear^.dY + cGravity;
-    if not (HHGear^.dY.isNegative) then
+    if Gear^.Timer > 0 then dec(Gear^.Timer);
+    if not (HHGear^.dY.isNegative) or (Gear^.Timer = 0) then
         begin
         HHGear^.State := HHGear^.State or gstMoving;
         DeleteGear(Gear);
--- a/hedgewars/uGearsList.pas	Mon Dec 23 03:15:39 2013 +0200
+++ b/hedgewars/uGearsList.pas	Mon Dec 23 00:52:02 2013 -0500
@@ -395,6 +395,7 @@
                     end
                 end;
    gtFirePunch: begin
+                if gear^.Timer = 0 then gear^.Timer:= 3000;
                 gear^.Radius:= 15;
                 gear^.Tag:= Y
                 end;