aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut7
1 files changed, 7 insertions, 0 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut
index b27892f7..8f34541b 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut
@@ -13,6 +13,7 @@ void function GamemodeGG_Init()
AddCallback_OnPlayerRespawned( OnPlayerRespawned )
AddCallback_OnPlayerKilled( OnPlayerKilled )
+ AddCallback_OnClientDisconnected( OnPlayerDisconnected )
AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined )
@@ -27,6 +28,12 @@ void function GamemodeGG_Init()
catch ( ex ) {}
}
+void function OnPlayerDisconnected(entity player)
+{
+ // resetting a player's score when they leave prevents a new player to join the leaver's team and having the previous player's points
+ AddTeamScore( player.GetTeam(), -GameRules_GetTeamScore( player.GetTeam() ) )
+}
+
void function OnPlayerRespawned( entity player )
{
UpdateLoadout( player )