From 9bfce509a535b66e6ef7f39b7f55f7e9513aa0a7 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Thu, 25 Mar 2021 11:09:05 +0300 Subject: [PATCH] fix playercount and endless suicide bug --- MskGs/Classes/MskGs_Endless.uc | 13 ++++++++++++- MskGs/Classes/MskGs_Objective.uc | 4 +++- MskGs/Classes/MskGs_Survival.uc | 4 +++- MskGs/Classes/MskGs_VersusSurvival.uc | 4 +++- MskGs/Classes/MskGs_WeeklySurvival.uc | 4 +++- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/MskGs/Classes/MskGs_Endless.uc b/MskGs/Classes/MskGs_Endless.uc index f349ebb..58af573 100644 --- a/MskGs/Classes/MskGs_Endless.uc +++ b/MskGs/Classes/MskGs_Endless.uc @@ -1,5 +1,14 @@ class MskGs_Endless extends KFGameInfo_Endless; +function WaveEnded(EWaveEndCondition WinCondition) +{ + // fix bugs after tripware + if(!bWaveStarted && !MyKFGRI.bTraderIsOpen) + return; + + Super.WaveEnded(WinCondition); +} + function UpdateGameSettings() { local name SessionName; @@ -74,7 +83,9 @@ function UpdateGameSettings() { KFGameSettings.MapName = WorldInfo.GetMapName(true); foreach WorldInfo.AllControllers(class'PlayerController', PC) - if (PC.bIsPlayer) + if (PC.bIsPlayer + && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator) NumHumanPlayers++; KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers; } diff --git a/MskGs/Classes/MskGs_Objective.uc b/MskGs/Classes/MskGs_Objective.uc index d20a876..87727d3 100644 --- a/MskGs/Classes/MskGs_Objective.uc +++ b/MskGs/Classes/MskGs_Objective.uc @@ -74,7 +74,9 @@ function UpdateGameSettings() { KFGameSettings.MapName = WorldInfo.GetMapName(true); foreach WorldInfo.AllControllers(class'PlayerController', PC) - if (PC.bIsPlayer) + if (PC.bIsPlayer + && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator) NumHumanPlayers++; KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers; } diff --git a/MskGs/Classes/MskGs_Survival.uc b/MskGs/Classes/MskGs_Survival.uc index 4dd538c..12f4b6c 100644 --- a/MskGs/Classes/MskGs_Survival.uc +++ b/MskGs/Classes/MskGs_Survival.uc @@ -74,7 +74,9 @@ function UpdateGameSettings() { KFGameSettings.MapName = WorldInfo.GetMapName(true); foreach WorldInfo.AllControllers(class'PlayerController', PC) - if (PC.bIsPlayer) + if (PC.bIsPlayer + && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator) NumHumanPlayers++; KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers; } diff --git a/MskGs/Classes/MskGs_VersusSurvival.uc b/MskGs/Classes/MskGs_VersusSurvival.uc index 0cc674f..42bef88 100644 --- a/MskGs/Classes/MskGs_VersusSurvival.uc +++ b/MskGs/Classes/MskGs_VersusSurvival.uc @@ -74,7 +74,9 @@ function UpdateGameSettings() { KFGameSettings.MapName = WorldInfo.GetMapName(true); foreach WorldInfo.AllControllers(class'PlayerController', PC) - if (PC.bIsPlayer) + if (PC.bIsPlayer + && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator) NumHumanPlayers++; KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers; } diff --git a/MskGs/Classes/MskGs_WeeklySurvival.uc b/MskGs/Classes/MskGs_WeeklySurvival.uc index 274e4de..5e7bf5b 100644 --- a/MskGs/Classes/MskGs_WeeklySurvival.uc +++ b/MskGs/Classes/MskGs_WeeklySurvival.uc @@ -74,7 +74,9 @@ function UpdateGameSettings() { KFGameSettings.MapName = WorldInfo.GetMapName(true); foreach WorldInfo.AllControllers(class'PlayerController', PC) - if (PC.bIsPlayer) + if (PC.bIsPlayer + && PC.PlayerReplicationInfo != none + && !PC.PlayerReplicationInfo.bOnlySpectator) NumHumanPlayers++; KFGameSettings.NumOpenPublicConnections = KFGameSettings.NumPublicConnections - NumHumanPlayers; }