aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
authorLightBlueCube <115393812+LightBlueCube@users.noreply.github.com>2024-09-10 06:26:23 +0800
committerGitHub <noreply@github.com>2024-09-10 00:26:23 +0200
commitee33fd31e7559630260541bef3492ef895647b8c (patch)
tree488ba40ec6003ae22d4642b141f4efeb2db45687 /Northstar.CustomServers/mod/scripts/vscripts/mp
parentbf5f6b02e8ad74ece0aa43d21a6cec88db6641ed (diff)
downloadNorthstarMods-ee33fd31e7559630260541bef3492ef895647b8c.tar.gz
NorthstarMods-ee33fd31e7559630260541bef3492ef895647b8c.zip
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()`
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut4
1 files changed, 3 insertions, 1 deletions
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() )
{