From 2fb3f2bad5a38006cce892ede789c6d307ded505 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Tue, 29 Mar 2022 21:23:13 +0300 Subject: [PATCH] . --- MskGs/Classes/KFGameInfoHelper.uc | 8 ++++++ MskGs/Classes/MskGsMut.uc | 45 ++++++++++++++++--------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/MskGs/Classes/KFGameInfoHelper.uc b/MskGs/Classes/KFGameInfoHelper.uc index ec58528..2797cde 100644 --- a/MskGs/Classes/KFGameInfoHelper.uc +++ b/MskGs/Classes/KFGameInfoHelper.uc @@ -74,9 +74,17 @@ public static function UpdateGameSettings(KFGameInfo_Survival KFGI, bool bUsesSt if (KFGI.WorldInfo.IsConsoleDedicatedServer() || KFGI.WorldInfo.IsEOSDedicatedServer()) { KFGameSettings.MapName = KFGI.WorldInfo.GetMapName(true); + // Old: + //foreach KFGI.WorldInfo.AllControllers(class'PlayerController', PC) + // if (PC.bIsPlayer + // && PC.PlayerReplicationInfo != none + // && !PC.PlayerReplicationInfo.bBot) + // NumHumanPlayers++; + foreach KFGI.WorldInfo.AllControllers(class'PlayerController', PC) if (PC.bIsPlayer && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator && !PC.PlayerReplicationInfo.bBot) NumHumanPlayers++; diff --git a/MskGs/Classes/MskGsMut.uc b/MskGs/Classes/MskGsMut.uc index cfb1c43..b9ab532 100644 --- a/MskGs/Classes/MskGsMut.uc +++ b/MskGs/Classes/MskGsMut.uc @@ -322,32 +322,35 @@ function NotifyLogout(Controller C) VoteCollector = MskGsVoteCollector(MyKFGI.MyKFGRI.VoteCollector); VoteCollector.NotifyLogout(C); - MskGsMemberList.RemoveItem(C); - if (bXpNotifications) + if (MskGsMemberList.Find(C) != INDEX_NONE) { - if (MskGsMemberList.Length >= 10) + MskGsMemberList.RemoveItem(C); + if (bXpNotifications) { - if (C.PlayerReplicationInfo != NONE) - WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. XP bonus: +50% (MAX!)"); + if (MskGsMemberList.Length >= 10) + { + if (C.PlayerReplicationInfo != NONE) + WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. XP bonus: +50% (MAX!)"); + else + WorldInfo.Game.Broadcast(C, "XP bonus: +50% (MAX!)"); + } + else if (MskGsMemberList.Length > 0) + { + if (C.PlayerReplicationInfo != NONE) + WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. XP bonus: +"$string(MskGsMemberList.Length * 5)$"%"); + else + WorldInfo.Game.Broadcast(C, "XP bonus: +"$string(MskGsMemberList.Length * 5)$"%"); + } else - WorldInfo.Game.Broadcast(C, "XP bonus: +50% (MAX!)"); - } - else if (MskGsMemberList.Length > 0) - { - if (C.PlayerReplicationInfo != NONE) - WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. XP bonus: +"$string(MskGsMemberList.Length * 5)$"%"); - else - WorldInfo.Game.Broadcast(C, "XP bonus: +"$string(MskGsMemberList.Length * 5)$"%"); - } - else - { - if (C.PlayerReplicationInfo != NONE) - WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. No XP bonus now."); - else - WorldInfo.Game.Broadcast(C, "No XP bonus now."); + { + if (C.PlayerReplicationInfo != NONE) + WorldInfo.Game.Broadcast(C, C.PlayerReplicationInfo.PlayerName$" left the game. No XP bonus now."); + else + WorldInfo.Game.Broadcast(C, "No XP bonus now."); + } } + MyKFGI.UpdateGameSettings(); } - MyKFGI.UpdateGameSettings(); for (i = RepClients.Length - 1; i >= 0; i--) {