From 36c08fa5f800e3fdff4690417ce756c20e6ec8f5 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 12 Jan 2022 02:00:20 +0000 Subject: fix WaittillAnimOver issue when swapping loadouts in dropship intro --- .../mod/scripts/vscripts/_loadouts_mp.gnut | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut index abd189e82..a31963cf6 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut @@ -267,15 +267,25 @@ void function TryGivePilotLoadoutForGracePeriod( entity player ) if ( ( ( Time() - respawnTimeReal <= CLASS_CHANGE_GRACE_PERIOD || GetGameState() < eGameState.Playing ) && file.loadoutGracePeriodEnabled ) || player.p.usingLoadoutCrate ) { - // because the game sucks and stuff Loadouts_TryGivePilotLoadout doesn't work in intro so have to do this manually - int loadoutIndex = GetPersistentSpawnLoadoutIndex( player, "pilot" ) - GivePilotLoadout( player, GetPilotLoadoutFromPersistentData( player, loadoutIndex ) ) - SetActivePilotLoadout( player ) - SetActivePilotLoadoutIndex( player, loadoutIndex ) + if ( !Loadouts_CanGivePilotLoadout( player ) && player.GetParent() != null && ( HasCinematicFlag( player, CE_FLAG_INTRO ) || HasCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) || HasCinematicFlag( player, CE_FLAG_WAVE_SPAWNING ) ) ) + thread GiveLoadoutWhenIntroOver( player ) + else + Loadouts_TryGivePilotLoadout( player ) player.p.usingLoadoutCrate = false } else SendHudMessage( player, "#LOADOUT_CHANGE_NEXT_BOTH", -1, 0.4, 255, 255, 255, 255, 0.15, 3.0, 0.5 ) // like 90% sure this is innacurate lol } -} \ No newline at end of file +} + +void function GiveLoadoutWhenIntroOver( entity player ) +{ + player.EndSignal( "OnDestroy" ) + player.EndSignal( "OnDeath" ) + + while ( player.GetParent() != null && ( HasCinematicFlag( player, CE_FLAG_INTRO ) || HasCinematicFlag( player, CE_FLAG_CLASSIC_MP_SPAWNING ) || HasCinematicFlag( player, CE_FLAG_WAVE_SPAWNING ) ) ) + WaitFrame() + + Loadouts_TryGivePilotLoadout( player ) +} -- cgit v1.2.3