hedgewars/uTouch.pas
changeset 7108 eaef11c0d039
parent 7105 9007531f813f
child 7185 92a045156255
equal deleted inserted replaced
7084:a471de309dcc 7108:eaef11c0d039
   269             if(Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0)then
   269             if(Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0)then
   270                 begin
   270                 begin
   271                 ParseTeamCommand('put');
   271                 ParseTeamCommand('put');
   272                 targetted:= true;
   272                 targetted:= true;
   273                 end
   273                 end
   274             else if CurAmmoGear^.AmmoType = amSwitch then
   274             else if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amSwitch) then
   275                 ParseTeamCommand('switch')
   275                 ParseTeamCommand('switch')
   276             else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
   276             else WriteLnToConsole(inttostr(ord(Ammoz[CurrentHedgehog^.CurAmmoType].NameId)) + ' ' + inttostr(ord(sidSwitch)));
   277     end;
   277     end;
   278         
   278         
   279 if targetting then
   279 if targetting then
   317     begin 
   317     begin 
   318     if isOnRect(AmmoRect, finger) then
   318     if isOnRect(AmmoRect, finger) then
   319         begin
   319         begin
   320         CursorPoint.X:= finger.x;
   320         CursorPoint.X:= finger.x;
   321         CursorPoint.Y:= finger.y;
   321         CursorPoint.Y:= finger.y;
   322         doPut(CursorPoint.X, CursorPoint.Y, false); 
   322         ParseTeamCommand('put'); 
   323         end
   323         end
   324     else
   324     else
   325         bShowAmmoMenu:= false;
   325         bShowAmmoMenu:= false;
   326     exit;
   326     exit;
   327     end;
   327     end;