aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-27 19:43:50 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-27 19:43:50 +0000
commitfff623afa9f3c49b4b4bdacfb71e5f1badca4c94 (patch)
tree57c3fa8de3e58fa4f3ec2666f527378c1c3bd28b /Northstar.CustomServers
parent449cb6f54c9fbad225dd9c6b1651a738b1dcabce (diff)
downloadNorthstarMods-fff623afa9f3c49b4b4bdacfb71e5f1badca4c94.tar.gz
NorthstarMods-fff623afa9f3c49b4b4bdacfb71e5f1badca4c94.zip
fix general killreplay weirdness
Diffstat (limited to 'Northstar.CustomServers')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut11
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 6945fb964..62f7d4595 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 )