hedgewars/uCommandHandlers.pas
changeset 7103 1c1afb5a1565
parent 7068 b1b7eb9c8cc9
child 7104 2468316c1d9d
equal deleted inserted replaced
7102:96f655d06e9e 7103:1c1afb5a1565
   410     Message:= Message or (gmSwitch and InputMask);
   410     Message:= Message or (gmSwitch and InputMask);
   411     ScriptCall('onSwitch');
   411     ScriptCall('onSwitch');
   412 end;
   412 end;
   413 
   413 
   414 procedure chNextTurn(var s: shortstring);
   414 procedure chNextTurn(var s: shortstring);
       
   415 var checksum: Longword;
   415 begin
   416 begin
   416     s:= s; // avoid compiler hint
   417     s:= s; // avoid compiler hint
       
   418 
   417     TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
   419     TryDo(AllInactive, '/nextturn called when not all gears are inactive', true);
   418 
   420 
       
   421     checksum:= GameTicks;
       
   422 
   419     if not CurrentTeam^.ExtDriven then
   423     if not CurrentTeam^.ExtDriven then
   420         SendIPC(_S'N');
   424         begin
       
   425         s[0]:= #5;
       
   426         s[1]:= 'N';
       
   427         SDLNet_Write32(checksum, @s[2]);
       
   428         SendIPC(s)
       
   429         end
       
   430     else
       
   431         TryDo(checksum = lastTurnChecksum, 'Desync detected', true);
   421     AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
   432     AddFileLog('Doing SwitchHedgehog: time '+inttostr(GameTicks));
   422 end;
   433 end;
   423 
   434 
   424 procedure chTimer(var s: shortstring);
   435 procedure chTimer(var s: shortstring);
   425 begin
   436 begin