hedgewars/uCommands.pas
changeset 6919 bf7433e62b9c
parent 6898 344b0dbd9690
child 6923 d2405a6a86f5
--- a/hedgewars/uCommands.pas	Mon Apr 23 19:22:43 2012 +0200
+++ b/hedgewars/uCommands.pas	Mon Apr 23 19:23:28 2012 +0200
@@ -29,6 +29,7 @@
 procedure freeModule;
 procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean);
 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
+procedure ParseTeamCommand(s: shortstring);
 procedure StopMessages(Message: Longword);
 
 implementation
@@ -99,6 +100,18 @@
         WriteLnToConsole(errmsgUnknownCommand  + ': "/' + CmdStr + '"') end
 end;
 
+procedure ParseTeamCommand(s: shortstring);
+var Trusted: boolean;
+begin
+Trusted:= (CurrentTeam <> nil)
+          and (not CurrentTeam^.ExtDriven)
+          and (CurrentHedgehog^.BotLevel = 0);
+ParseCommand(s, Trusted);
+if (CurrentTeam <> nil) and (not CurrentTeam^.ExtDriven) and (ReadyTimeLeft > 1) then
+    ParseCommand('gencmd R', true)
+end;
+
+
 
 procedure StopMessages(Message: Longword);
 begin