aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut19
1 files changed, 18 insertions, 1 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut
index 7ac728de5..812c21ee6 100644
--- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut
+++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_sns.gnut
@@ -27,6 +27,7 @@ void function SNS_Init()
AddCallback_OnPlayerKilled( OnPlayerKilled )
AddCallback_OnPlayerRespawned( OnPlayerRespawned )
+ AddCallback_OnClientDisconnected(OnPlayerDisconnected)
AddCallback_GameStateEnter( eGameState.WinnerDetermined, OnWinnerDetermined )
file.reset_pulse_blade_cooldown_on_pulse_blade_kill = GetCurrentPlaylistVarInt( "sns_reset_pulse_blade_cooldown_on_pulse_blade_kill", 1 ) == 1
@@ -38,6 +39,22 @@ void function SNS_Init()
file.melee_kill_value = GetCurrentPlaylistVarInt( "sns_melee_kill_value", 5 )
}
+void function OnPlayerDisconnected(entity player)
+{
+ if (GetWinningPlayer() == player)
+ thread CheckNewHighlight(player)
+}
+
+void function CheckNewHighlight(entity player)
+{
+ while (IsValid(player)) //wait till disconnected player not exist
+ wait 0.25
+
+ entity winner = GetWinningPlayer()
+ if (IsValid(winner))
+ SetHighlight(winner)
+}
+
void function OnPlayerKilled( entity victim, entity attacker, var damageInfo )
{
if ( victim != attacker && victim.IsPlayer() && attacker.IsPlayer() && GetGameState() == eGameState.Playing )
@@ -161,4 +178,4 @@ void function SetHighlight(entity player) {
foreach ( entity player in GetPlayerArray() )
Highlight_ClearEnemyHighlight(player)
Highlight_SetEnemyHighlight( player, file.score_leader_highlight )
-} \ No newline at end of file
+}