From ee33fd31e7559630260541bef3492ef895647b8c Mon Sep 17 00:00:00 2001 From: LightBlueCube <115393812+LightBlueCube@users.noreply.github.com> Date: Tue, 10 Sep 2024 06:26:23 +0800 Subject: Fix crash when player is in a special team (#866) on player team switch. Adds a check whether player is in a default team (IMC/Milita) before calling `GetOtherTeam()` --- Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index f7c398d9..5d3777b4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -1062,7 +1062,9 @@ void function OnPlayerChangedTeam( entity player ) if ( !player.hasConnected ) // Prevents players who just joined to trigger below code, as server always pre setups their teams return - NotifyClientsOfTeamChange( player, GetOtherTeam( player.GetTeam() ), player.GetTeam() ) + // only TEAM_IMC and TEAM_MILITIA can use function GetOtherTeam(), doesnt need to notify them when player got a special team + if( IsIMCOrMilitiaTeam( player.GetTeam() ) ) + NotifyClientsOfTeamChange( player, GetOtherTeam( player.GetTeam() ), player.GetTeam() ) foreach( npc in GetNPCArray() ) { -- cgit v1.2.3