From 11b921b75f679ec727a0af28a6499bbaba17eca2 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Sun, 1 Mar 2020 22:42:29 +0300 Subject: [PATCH] host can't spawn during an LMS round anymore --- src/game/g_game.pas | 6 ++++++ src/game/g_netmsg.pas | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/game/g_game.pas b/src/game/g_game.pas index bc645b0..f448602 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -4251,6 +4251,10 @@ begin if ((not gGameOn) and (gState <> STATE_INTERCUSTOM)) or (not (gGameSettings.GameType in [GT_CUSTOM, GT_SERVER, GT_CLIENT])) then Exit; + + if (gGameSettings.MaxLives > 0) and (gLMSRespawn = LMS_RESPAWN_NONE) then + Exit; + if gPlayer1 = nil then begin if g_Game_IsClient then @@ -5220,6 +5224,8 @@ begin gLMSRespawn := LMS_RESPAWN_WARMUP; gLMSRespawnTime := gTime + gGameSettings.WarmupTime*1000; gLMSSoftSpawn := NoMapRestart; + if g_Game_IsNet then + MH_SEND_GameEvent(NET_EV_LMS_WARMUP, gLMSRespawnTime - gTime); Exit; end; diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 57e5136..5e95a6a 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -595,7 +595,7 @@ begin begin if Pl.FSpectator then begin - if (gGameSettings.MaxLives = 0) or (gLMSRespawn = LMS_RESPAWN_WARMUP) then + if (gGameSettings.MaxLives = 0) or (gLMSRespawn > LMS_RESPAWN_NONE) then Pl.Respawn(False) else MH_SEND_GameEvent(NET_EV_LMS_NOSPAWN, Pl.UID); @@ -2344,12 +2344,12 @@ begin FSpectator := M.ReadByte() <> 0; if FSpectator then begin - if PID = NetPlrUID1 then + if UID = NetPlrUID1 then begin gSpectLatchPID1 := UID; gPlayer1 := nil; end; - if PID = NetPlrUID2 then + if UID = NetPlrUID2 then begin gSpectLatchPID2 := UID; gPlayer2 := nil; -- 2.29.2