From 30bc58c9ab1563a1dcbbb671db9ee446dc7df37d Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 11 Dec 2021 22:28:45 +0000 Subject: more fixes --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 11 +++++++++++ .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp') 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 5a0ec9894..0425f1d79 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -40,6 +40,8 @@ void function BaseGametype_Init_MPSP() AddDamageCallback( "player", AddToTitanDamageStat ) AddDamageCallback( "npc_titan", AddToTitanDamageStat ) + + RegisterSignal( "PlayerRespawnStarted" ) } void function SetIntermissionCamera( entity camera ) @@ -394,6 +396,8 @@ void function RespawnAsPilot( entity player, bool manualPosition = false ) void function RespawnAsTitan( entity player, bool manualPosition = false ) { + player.Signal( "PlayerRespawnStarted" ) + player.isSpawning = true entity spawnpoint = FindSpawnPoint( player, true, ShouldStartSpawn( player ) && !IsFFAGame() ) @@ -459,9 +463,16 @@ void function PlayerBecomesSpectator( entity player ) player.EndSignal( "OnRespawned" ) player.EndSignal( "OnDestroy" ) + player.EndSignal( "PlayerRespawnStarted" ) int targetIndex = 0 + OnThreadEnd( function() : ( player ) + { + if ( IsValid( player ) ) + player.StopObserverMode() + }) + while ( true ) { table result = player.WaitSignal( "ObserverTargetChanged" ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 58c8bb9bf..83d889dda 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -320,10 +320,11 @@ void function GameStateEnter_WinnerDetermined_Threaded() foreach( entity player in GetPlayerArray() ) { player.FreezeControlsOnServer() - ScreenFadeToBlackForever( player, 2.0 ) + ScreenFadeToBlackForever( player, 4.0 ) } - wait 2.5 + wait 6.5 + CleanUpEntitiesForRoundEnd() // fade should be done by this point, so cleanup stuff now when people won't see foreach( entity player in GetPlayerArray() ) player.UnfreezeControlsOnServer() -- cgit v1.2.3