diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-12 02:00:20 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-12 02:00:20 +0000 |
commit | 36c08fa5f800e3fdff4690417ce756c20e6ec8f5 (patch) | |
tree | 926d2a0d71c7ef299d41b7b6e71912d24be65de0 | |
parent | 24b9bfc941fcd84604d040443cc65f70602d920b (diff) | |
download | NorthstarMods-36c08fa5f800e3fdff4690417ce756c20e6ec8f5.tar.gz NorthstarMods-36c08fa5f800e3fdff4690417ce756c20e6ec8f5.zip |
fix WaittillAnimOver issue when swapping loadouts in dropship intro
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut index abd189e8..a31963cf 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 ) +} |