From 27bd240871b7c0f2f49fef137718b2e3c208e3b4 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 17 Jul 2021 23:46:52 +0100 Subject: ctf switchsides spawn fix (untested) --- .../scripts/vscripts/mp/_base_gametype_mp.gnut | 17 +++++++++++++---- .../scripts/vscripts/mp/_classic_mp_dropship_intro.gnut | 13 ++++++++++--- .../scripts/vscripts/mp/_gamestate_mp.nut | 4 +++- 3 files changed, 26 insertions(+), 8 deletions(-) (limited to 'Northstar.CustomServers/scripts/vscripts/mp') diff --git a/Northstar.CustomServers/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/scripts/vscripts/mp/_base_gametype_mp.gnut index 9d2ccc919..9274854a2 100644 --- a/Northstar.CustomServers/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -339,8 +339,7 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga if ( "respawnTime" in attacker.s ) respawnTime = Time() - expect float ( attacker.s.respawnTime ) - thread PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), respawnTime, timeOfDeath, beforeTime, replayTracker ) - thread EndReplayOnTime( player, replayLength ) + thread PlayerWatchesKillReplayWrapper( player, attacker, respawnTime, timeOfDeath, beforeTime, replayTracker ) } player.SetPlayerSettings( "spectator" ) // prevent a crash with going from titan => pilot on respawn @@ -356,10 +355,10 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga SetRespawnAvailable( player ) wait respawnDelay + + player.WaitSignal( "RespawnMe" ) // set in base_gametype: ClientCommand_RespawnPlayer player.SetPredictionEnabled( true ) - - player.WaitSignal( "RespawnMe" ) // set in base_gametype: ClientCommand_RespawnPlayer ClearRespawnAvailable( player ) // need so the respawn icon doesn't show for like a frame on next death if ( ( expect bool( player.GetPersistentVar( "spawnAsTitan" ) ) && IsTitanAvailable( player ) ) || ( Riff_SpawnAsTitan() > 0 && Riff_ShouldSpawnAsTitan( player ) ) ) // spawn as titan @@ -373,6 +372,14 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga } } +void function PlayerWatchesKillReplayWrapper( entity player, entity attacker, float timeSinceAttackerSpawned, float timeOfDeath, float beforeTime, table replayTracker ) +{ + PlayerWatchesKillReplay( player, attacker.GetEncodedEHandle(), attacker.GetIndexForEntity(), timeSinceAttackerSpawned, timeOfDeath, beforeTime, replayTracker ) + player.ClearReplayDelay() + player.ClearViewEntity() + player.SetPredictionEnabled( true ) +} + void function EndReplayOnTime( entity player, float replayLength ) { player.EndSignal( "RespawnMe" ) @@ -381,6 +388,8 @@ void function EndReplayOnTime( entity player, float replayLength ) wait replayLength if ( IsValid( player ) && KillcamsEnabled() ) { + print( "fucking how" ) + player.ClearReplayDelay() player.ClearViewEntity() player.SetPredictionEnabled( true ) diff --git a/Northstar.CustomServers/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut b/Northstar.CustomServers/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut index 7d5fb9f0d..02c312be3 100644 --- a/Northstar.CustomServers/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut +++ b/Northstar.CustomServers/scripts/vscripts/mp/_classic_mp_dropship_intro.gnut @@ -72,9 +72,6 @@ void function DropshipIntro_OnClientConnected( entity player ) return } - - // if we're at this point, we have more players than we do dropships, oh dear - RespawnAsPilot( player ) } void function DropshipIntro_OnClientDisconnected( entity player ) @@ -159,6 +156,16 @@ void function SpawnPlayerIntoDropship( entity player ) break } + + if ( playerDropship.dropship == null ) + { + // if we're at this point, we have more players than we do dropships, oh dear + ScreenFadeFromBlack( player, 0.0 ) + RespawnAsPilot( player ) + + file.numPlayersInIntro-- + return + } // figure out what anims we're using for idle string idleAnim = DROPSHIP_IDLE_ANIMS[ playerDropshipIndex ] diff --git a/Northstar.CustomServers/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/scripts/vscripts/mp/_gamestate_mp.nut index bbeb72fbb..96a61b69f 100644 --- a/Northstar.CustomServers/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/scripts/vscripts/mp/_gamestate_mp.nut @@ -51,7 +51,7 @@ struct { void function PIN_GameStart() { - // todo: using the pin telemetry function here is weird and was done veeery early on before i knew how this all worked, should use a different one + // todo: using the pin telemetry function here, weird and was done veeery early on before i knew how this all worked, should use a different one // called from InitGameState //FlagInit( "ReadyToStartMatch" ) @@ -596,6 +596,8 @@ void function CleanUpEntitiesForRoundEnd() foreach ( entity player in GetPlayerArray() ) { + ClearTitanAvailable( player ) + if ( IsAlive( player ) ) player.Die() -- cgit v1.2.3