diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-27 19:43:50 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-27 19:43:50 +0000 |
commit | fff623afa9f3c49b4b4bdacfb71e5f1badca4c94 (patch) | |
tree | 57c3fa8de3e58fa4f3ec2666f527378c1c3bd28b | |
parent | 449cb6f54c9fbad225dd9c6b1651a738b1dcabce (diff) | |
download | NorthstarMods-fff623afa9f3c49b4b4bdacfb71e5f1badca4c94.tar.gz NorthstarMods-fff623afa9f3c49b4b4bdacfb71e5f1badca4c94.zip |
fix general killreplay weirdness
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index 6945fb96..62f7d459 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -42,6 +42,7 @@ void function BaseGametype_Init_MPSP() AddPostDamageCallback( "npc_titan", AddToTitanDamageStat ) RegisterSignal( "PlayerRespawnStarted" ) + RegisterSignal( "KillCamOver" ) } void function SetIntermissionCamera( entity camera ) @@ -316,8 +317,10 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga player.SetObserverTarget( null ) } + // hack: double check if killcams are enabled and valid here in case gamestate has changed this + shouldDoReplay = shouldDoReplay && Replay_IsEnabled() && KillcamsEnabled() && IsValid( attacker ) // quick note: in cases where player.Die() is called: e.g. for round ends, player == attacker - if ( shouldDoReplay && Replay_IsEnabled() && KillcamsEnabled() && IsValid( attacker ) ) // hack: double check if killcams are enabled and valid here in case gamestate has changed this + if ( shouldDoReplay ) { player.watchingKillreplayEndTime = Time() + replayLength float beforeTime = GetKillReplayBeforeTime( player, methodOfDeath ) @@ -355,7 +358,12 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga RespawnAsPilot( player ) } else if ( GamePlayingOrSuddenDeath() || GetGameState() == eGameState.Epilogue ) + { + if ( shouldDoReplay && player.IsWatchingKillReplay() ) + player.WaitSignal( "KillCamOver" ) + thread PlayerBecomesSpectator( player ) + } } void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker ) @@ -373,6 +381,7 @@ void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, fl // don't clear if we're in a roundwinningkillreplay if ( IsValid( player ) && !( ( GetGameState() == eGameState.SwitchingSides || GetGameState() == eGameState.WinnerDetermined ) && IsRoundWinningKillReplayEnabled() ) ) { + player.Signal( "KillCamOver" ) player.ClearReplayDelay() player.ClearViewEntity() player.SetPredictionEnabled( true ) |