hedgewars/uIO.pas
changeset 15908 014f4edd0421
parent 15156 7a8cc8bc963e
--- a/hedgewars/uIO.pas	Thu Oct 06 20:58:54 2022 +0300
+++ b/hedgewars/uIO.pas	Sun Oct 16 13:14:16 2022 +0300
@@ -36,10 +36,10 @@
 procedure IPCWaitPongEvent;
 procedure IPCCheckSock;
 procedure NetGetNextCmd;
-procedure doPut(putX, putY: LongInt; fromAI: boolean);
+procedure doPut(putX, putY: LongInt; fromAI, extSource: boolean);
 
 implementation
-uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug, uLocale, uSound;
+uses uConsole, uConsts, uVariables, uCommands, uUtils, uDebug, uLocale, uSound, uDrawing;
 
 const
     cSendEmptyPacketTime = 1000;
@@ -207,6 +207,10 @@
              end
           else
              isProcessed:= false;
+     'O': begin
+              s:= copy(s, 2, Length(s) - 1);
+              uDrawing.handleIPCInput(s);
+          end;
      else
         isProcessed:= false;
      end;
@@ -443,7 +447,7 @@
         'p': begin
             x32:= SDLNet_Read32(@(headcmd^.str[2]));
             y32:= SDLNet_Read32(@(headcmd^.str[6]));
-            doPut(x32, y32, false)
+            doPut(x32, y32, false, true)
              end;
         'P': begin
             // these are equations solved for CursorPoint
@@ -498,9 +502,10 @@
         halt(HaltFatalErrorNoIPC);
 end;
 
-procedure doPut(putX, putY: LongInt; fromAI: boolean);
+procedure doPut(putX, putY: LongInt; fromAI, extSource: boolean);
 begin
-if CheckNoTeamOrHH or isPaused then
+if CheckNoTeamOrHH or isPaused or (CurrentTeam^.ExtDriven and (not extSource)) or
+   (CurrentHedgehog = nil) or ((CurrentHedgehog^.BotLevel <> 0) and (not fromAI)) then
     exit;
 bShowFinger:= false;
 if (not CurrentTeam^.ExtDriven) and bShowAmmoMenu then