diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp')
5 files changed, 19 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 ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_changemap.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_changemap.nut index 470fa6a41..16a3ce922 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_changemap.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_changemap.nut @@ -34,7 +34,10 @@ void function CodeCallback_MatchIsOver() for ( int j = 0; j < GetCurrentPlaylistGamemodeByIndexMapsCount( i ); j++ ) { if ( changeOnNextIteration ) + { GameRules_ChangeMap( GetCurrentPlaylistGamemodeByIndexMapByIndex( i, j ), GetCurrentPlaylistGamemodeByIndex( i ) ) + return + } if ( GetCurrentPlaylistGamemodeByIndexMapByIndex( i, j ) == GetMapName() ) changeOnNextIteration = true // change to next map/mode we iterate over diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut index 7ca1246b1..4f6a12914 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut @@ -203,6 +203,9 @@ void function SpawnPlayerIntoDropship( entity player ) void function PlayerJumpsFromDropship( entity player ) { + player.EndSignal( "OnDeath" ) + player.EndSignal( "OnDestroy" ) + OnThreadEnd( function() : ( player ) { if ( IsValid( player ) ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 6518b6336..2f16379e2 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -451,6 +451,7 @@ void function GameStateEnter_SwitchingSides_Threaded() void function PlayerWatchesSwitchingSidesKillReplay( entity player, bool doReplay, float replayLength ) { + player.EndSignal( "OnDestroy" ) player.FreezeControlsOnServer() ScreenFadeToBlackForever( player, SWITCHING_SIDES_DELAY_REPLAY ) // automatically cleared diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut index 58a4be024..92307f3cb 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/levels/mp_wargames.nut @@ -191,6 +191,7 @@ void function PlayerWatchesWargamesIntro( entity player ) player.ClearParent() player.UnforceStand() player.MovementEnable() + player.ClearInvulnerable() Remote_CallFunction_NonReplay( player, "ServerCallback_ClearFactionLeaderIntro" ) } }) @@ -224,6 +225,7 @@ void function PlayerWatchesWargamesIntro( entity player ) TrainingPod_ViewConeLock_PodClosed( player ) player.DisableWeaponViewModel() player.MovementDisable() + player.SetInvulnerable() // spawn faction leader // no clue why client subtracts 4.5 from the time we give this, so just add it here instead |