From: fgsfds Date: Sun, 9 Feb 2020 21:37:52 +0000 (+0300) Subject: fix playerstats netmessage; zero gTime before spawning players X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=9ecce49b43c44343c6061091189b48888520bdf1;p=d2df-sdl.git fix playerstats netmessage; zero gTime before spawning players --- 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: