hedgewars/uGame.pas
changeset 2382 bfd378dfc4e7
parent 1727 bddbb2400c30
child 2579 e5e4ebf528b5
--- a/hedgewars/uGame.pas	Wed Sep 16 12:48:27 2009 +0000
+++ b/hedgewars/uGame.pas	Wed Sep 16 14:44:40 2009 +0000
@@ -31,21 +31,15 @@
 uses uMisc, uConsts, uWorld, uKeys, uTeams, uIO, uAI, uGears, uConsole;
 
 procedure DoGameTick(Lag: LongInt);
-const SendEmptyPacketTicks: LongWord = 0;
 var i: LongInt;
 begin
 if isPaused then exit;
 if (not CurrentTeam^.ExtDriven) then
-   begin
-   NetGetNextCmd; // its for the case of receiving "/say" message
-   isInLag:= false;
-   inc(SendEmptyPacketTicks, Lag);
-   if (SendEmptyPacketTicks >= cSendEmptyPacketTime) then
-      begin
-      SendIPC('+');
-      SendEmptyPacketTicks:= 0
-      end
-   end;
+	begin
+	NetGetNextCmd; // its for the case of receiving "/say" message
+	isInLag:= false;
+	SendKeepAliveMessage(Lag)
+	end;
 if Lag > 100 then Lag:= 100
 else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then Lag:= 2500;
 if (GameType = gmtDemo) and isSpeed then Lag:= Lag * 10;