hedgewars/uCommandHandlers.pas
changeset 7790 040fc517fece
parent 7722 1518827049ed
child 7805 2a249a4faf5b
equal deleted inserted replaced
7789:838d2e06c377 7790:040fc517fece
   440     AddFileLog('Next turn: time '+inttostr(GameTicks));
   440     AddFileLog('Next turn: time '+inttostr(GameTicks));
   441 end;
   441 end;
   442 
   442 
   443 procedure chTimer(var s: shortstring);
   443 procedure chTimer(var s: shortstring);
   444 begin
   444 begin
   445 if (s[0] <> #1) or (s[1] < '1') or (s[1] > '5') or CheckNoTeamOrHH then
   445 if CheckNoTeamOrHH then
   446     exit;
   446     exit;
       
   447 
       
   448 TryDo((s[0] = #1) and (s[1] >= '1') and (s[1] <= '5'), 'Malformed /timer', true);
   447 
   449 
   448 if not CurrentTeam^.ExtDriven then
   450 if not CurrentTeam^.ExtDriven then
   449     SendIPC(s);
   451     SendIPC(s);
   450 bShowFinger:= false;
   452 bShowFinger:= false;
   451 with CurrentHedgehog^.Gear^ do
   453 with CurrentHedgehog^.Gear^ do
   480     end
   482     end
   481 end;
   483 end;
   482 
   484 
   483 procedure chSetWeapon(var s: shortstring);
   485 procedure chSetWeapon(var s: shortstring);
   484 begin
   486 begin
   485     if (s[0] <> #1) or CheckNoTeamOrHH then
   487     if CheckNoTeamOrHH then
   486         exit;
   488         exit;
   487 
   489 
   488     if TAmmoType(s[1]) > High(TAmmoType) then
   490     TryDo((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true);
   489         exit;
       
   490 
   491 
   491     if not CurrentTeam^.ExtDriven then
   492     if not CurrentTeam^.ExtDriven then
   492         SendIPC('w' + s);
   493         SendIPC('w' + s);
   493 
   494 
   494     with CurrentHedgehog^.Gear^ do
   495     with CurrentHedgehog^.Gear^ do