hedgewars/uTouch.pas
changeset 6962 ec308eabe09b
parent 6961 d5ac09894a1b
child 7022 107651b3c5a0
--- a/hedgewars/uTouch.pas	Sun Apr 29 18:08:46 2012 +0200
+++ b/hedgewars/uTouch.pas	Sun Apr 29 21:05:09 2012 +0200
@@ -265,12 +265,15 @@
         ParseTeamCommand('-attack');
     
     if widget = @utilityWidget then
-        if (CurrentHedgehog <> nil) and 
-           (Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0)then
-            begin
-            ParseTeamCommand('put');
-            targetted:= true;
-            end;
+        if (CurrentHedgehog <> nil)then
+            if(Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0)then
+                begin
+                ParseTeamCommand('put');
+                targetted:= true;
+                end
+            else if CurAmmoGear^.AmmoType = amSwitch then
+                ParseTeamCommand('switch')
+            else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
     end;
         
 if targetting then