aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-15 17:58:33 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-15 17:58:33 +0000
commit06924c215dcf8d4dd425cbbf178509bc222c2f7d (patch)
tree36db62761142f7a3430a5be26a335168d2da8d65 /Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
parent1b6e5af70bf442c684b891003e516329b190c130 (diff)
downloadNorthstarMods-06924c215dcf8d4dd425cbbf178509bc222c2f7d.tar.gz
NorthstarMods-06924c215dcf8d4dd425cbbf178509bc222c2f7d.zip
more playtest fixes
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut66
1 files changed, 30 insertions, 36 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
index 83d889dda..0eef7f005 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut
@@ -302,7 +302,7 @@ void function GameStateEnter_WinnerDetermined_Threaded()
SetServerVar( "roundWinningKillReplayEntHealthFrac", file.roundWinningKillReplayHealthFrac )
foreach ( entity player in GetPlayerArray() )
- thread PlayerWatchesRoundWinningKillReplay( player, doReplay, replayLength )
+ thread PlayerWatchesRoundWinningKillReplay( player, replayLength )
wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME
CleanUpEntitiesForRoundEnd() // fade should be done by this point, so cleanup stuff now when people won't see
@@ -323,7 +323,7 @@ void function GameStateEnter_WinnerDetermined_Threaded()
ScreenFadeToBlackForever( player, 4.0 )
}
- wait 6.5
+ wait ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY
CleanUpEntitiesForRoundEnd() // fade should be done by this point, so cleanup stuff now when people won't see
foreach( entity player in GetPlayerArray() )
@@ -360,45 +360,39 @@ void function GameStateEnter_WinnerDetermined_Threaded()
}
}
-void function PlayerWatchesRoundWinningKillReplay( entity player, bool doReplay, float replayLength )
+void function PlayerWatchesRoundWinningKillReplay( entity player, float replayLength )
{
+ // end if player dcs
+ player.EndSignal( "OnDestroy" )
+
player.FreezeControlsOnServer()
-
- if ( IsRoundBased() || !ClassicMP_ShouldRunEpilogue() ) // if we're doing evac, then no fades or killreplay
+ ScreenFadeToBlackForever( player, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME )
+ wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME
+
+ 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 ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay
{
- ScreenFadeToBlackForever( player, ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME )
- wait ROUND_WINNING_KILL_REPLAY_SCREEN_FADE_TIME
-
- if ( doReplay )
- {
- 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 ( replayLength >= ROUND_WINNING_KILL_REPLAY_LENGTH_OF_REPLAY - 0.5 ) // only do fade if close to full length replay
- {
- // this doesn't work because fades don't work on players that are in a replay, unsure how official servers do this
- wait replayLength - 2.0
- ScreenFadeToBlackForever( player, 2.0 )
+ // this doesn't work because fades don't work on players that are in a replay, unsure how official servers do this
+ wait replayLength - 2.0
+ ScreenFadeToBlackForever( player, 2.0 )
- wait 2.0
- }
- else
- wait replayLength
- }
- else
- wait replayLength // this will just be extra delay if no replay
-
- player.SetPredictionEnabled( true )
- player.ClearReplayDelay()
- player.ClearViewEntity()
- player.UnfreezeControlsOnServer()
+ wait 2.0
}
+ else
+ wait replayLength
+
+ player.SetPredictionEnabled( true )
+ player.ClearReplayDelay()
+ player.ClearViewEntity()
+ player.UnfreezeControlsOnServer()
}