From 9ecce49b43c44343c6061091189b48888520bdf1 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 10 Feb 2020 00:37:52 +0300 Subject: [PATCH] fix playerstats netmessage; zero gTime before spawning players --- src/game/g_game.pas | 3 ++- src/game/g_net.pas | 2 +- src/game/g_netmsg.pas | 1 + src/game/g_player.pas | 3 +++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 854a15a..3dc360c 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -4948,6 +4948,8 @@ begin ResName := Map; end; + gTime := 0; + //writeln('********: gsw=', gGameSettings.WAD, '; rn=', ResName); result := false; if (ResName <> '') and (NewWAD <> '') then @@ -4984,7 +4986,6 @@ begin gExit := 0; gPauseMain := false; gPauseHolmes := false; - gTime := 0; NetTimeToUpdate := 1; NetTimeToReliable := 0; NetTimeToMaster := NetMasterRate; diff --git a/src/game/g_net.pas b/src/game/g_net.pas index 0f1cf30..217825e 100644 --- a/src/game/g_net.pas +++ b/src/game/g_net.pas @@ -21,7 +21,7 @@ uses e_log, e_msg, ENet, Classes, md5, MAPDEF{$IFDEF USE_MINIUPNPC}, miniupnpc;{$ELSE};{$ENDIF} const - NET_PROTOCOL_VER = 183; + NET_PROTOCOL_VER = 184; NET_MAXCLIENTS = 24; NET_CHANS = 12; diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 235cbb1..1fd6f7c 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2354,6 +2354,7 @@ begin if (OldFire <= 0) and (FFireTime > 0) then g_Sound_PlayExAt('SOUND_IGNITE', Obj.X, Obj.Y); Flam := M.ReadByte() <> 0; + FSpawnInvul := M.ReadLongInt(); if OldJet and not FJetpack then JetpackOff else if not OldJet and FJetpack then diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 59e6456..2f089d7 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -4368,6 +4368,7 @@ begin FMonsterKills := 0; FDeath := 0; FSecrets := 0; + FSpawnInvul := 0; FReady := False; if FNoRespawn then begin @@ -4560,6 +4561,7 @@ begin FShellTimer := -1; FPain := 0; FLastHit := 0; + FSpawnInvul := 0; if not g_Game_IsServer then Exit; @@ -6303,6 +6305,7 @@ begin if FMegaRulez[MR_INVUL] < gTime+PLAYER_INVUL_TIME then begin FMegaRulez[MR_INVUL] := gTime+PLAYER_INVUL_TIME; + FSpawnInvul := 0; end; ITEM_INVIS: -- 2.29.2