enabled grenade timer, needs a button image
authorXeli
Sun, 29 Apr 2012 14:10:59 +0200
changeset 6956 7d9e2669c2f5
parent 6955 71498ea59193
child 6957 ab8034208fcd
enabled grenade timer, needs a button image
hedgewars/uInputHandler.pas
hedgewars/uTouch.pas
--- a/hedgewars/uTouch.pas	Sat Apr 28 15:18:30 2012 +0200
+++ b/hedgewars/uTouch.pas	Sun Apr 29 14:10:59 2012 +0200
@@ -22,7 +22,7 @@
 
 interface
 
-uses sysutils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions;
+uses sysutils, uConsole, uVariables, SDLh, uFloat, uConsts, uCommands, uIO, GLUnit, uTypes, uCaptions, uAmmos;
 
 
 procedure initModule;
@@ -149,7 +149,11 @@
 
 if isOnWidget(utilityWidget, finger^) then
     begin
-    //ParseCommand('/timer ' + inttostr((CurrentHedgeHog^.CurWeapon^.Timer div 1000 + 1) mod 5));
+    if(CurrentHedgehog <> nil) then
+        begin
+        if Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Timerable <> 0 then
+            ParseTeamCommand('/timer ' + inttostr((GetCurAmmoEntry(CurrentHedgeHog^)^.Timer div 1000) mod 5 + 1));
+        end;
     end; 
 dec(buttonsDown);//no buttonsDown, undo the inc() above
 if buttonsDown = 0 then