diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2022-07-29 19:29:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-29 20:29:22 +0200 |
commit | f1c0ec0d0adeac614efa6c5b982da9136eb910cd (patch) | |
tree | 58833ee36e487aab24806f630834dc3697a0848b | |
parent | ad82fac5e307fc1b6c5c21222eb53ebc1d87910d (diff) | |
download | NorthstarMods-f1c0ec0d0adeac614efa6c5b982da9136eb910cd.tar.gz NorthstarMods-f1c0ec0d0adeac614efa6c5b982da9136eb910cd.zip |
fix potential crash where player leaves while being wave mvp (#460)
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut index 639ab980..c31bcac4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_fd.nut @@ -654,8 +654,6 @@ bool function runWave( int waveIndex, bool shouldDoBuyTime ) EmitSoundOnEntityOnlyToPlayer( player, player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) } wait 1 - int highestScore = 0; - entity highestScore_player = GetPlayerArray()[0] foreach( entity player in GetPlayerArray() ) { if( !file.players[player].diedThisRound ) @@ -665,14 +663,18 @@ bool function runWave( int waveIndex, bool shouldDoBuyTime ) } AddMoneyToPlayer( player, 100 ) EmitSoundOnEntityOnlyToPlayer( player, player, "HUD_MP_BountyHunt_BankBonusPts_Deposit_Start_1P" ) + } + wait 1 + int highestScore = 0; + entity highestScore_player = GetPlayerArray()[0] + foreach( entity player in GetPlayerArray() ) + { if( highestScore < file.players[player].scoreThisRound ) { highestScore = file.players[player].scoreThisRound highestScore_player = player } - } - wait 1 file.players[highestScore_player].totalMVPs += 1 AddPlayerScore( highestScore_player, "FDWaveMVP" ) AddMoneyToPlayer( highestScore_player, 100 ) |