aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp
diff options
context:
space:
mode:
authorDinorush <62536724+Dinorush@users.noreply.github.com>2022-10-07 21:34:03 -0400
committerGitHub <noreply@github.com>2022-10-08 03:34:03 +0200
commitbcb6b30db6b051776e2585c3d162856b4e9481b3 (patch)
tree1f2e9f5e6c85cdd47659b22bc824fc8dd118f69c /Northstar.CustomServers/mod/scripts/vscripts/mp
parent5ac11bd422a7c65b167633197642106755fd1e68 (diff)
downloadNorthstarMods-bcb6b30db6b051776e2585c3d162856b4e9481b3.tar.gz
NorthstarMods-bcb6b30db6b051776e2585c3d162856b4e9481b3.zip
Fix crash when final killcam entity becomes invalid (#516)
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut13
1 files changed, 8 insertions, 5 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 4108d0d9..6cde4655 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -387,11 +387,14 @@ void function PlayerWatchesRoundWinningKillReplay( entity player, float replayLe
player.SetPredictionEnabled( false ) // prediction fucks with replays
entity attacker = file.roundWinningKillReplayAttacker
- player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS )
- player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() )
- player.SetKillReplayVictim( file.roundWinningKillReplayVictim )
- player.SetViewIndex( attacker.GetIndexForEntity() )
- player.SetIsReplayRoundWinning( true )
+ if ( IsValid( attacker ) )
+ {
+ player.SetKillReplayDelay( Time() - replayLength, THIRD_PERSON_KILL_REPLAY_ALWAYS )
+ player.SetKillReplayInflictorEHandle( attacker.GetEncodedEHandle() )
+ player.SetKillReplayVictim( file.roundWinningKillReplayVictim )
+ player.SetViewIndex( attacker.GetIndexForEntity() )
+ player.SetIsReplayRoundWinning( true )
+ }
if ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay
{