From e8f67265e817bdca167fbb9970327588501be580 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Wed, 29 Dec 2021 02:13:26 +0000 Subject: fix burnmeter and fastball crashes --- .../scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut | 6 ++++++ .../mod/scripts/vscripts/_menu_callbacks.gnut | 3 ++- .../mod/scripts/vscripts/burnmeter/_burnmeter.gnut | 12 +++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut index 5f2e6adc..2a137744 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_fastball_intro.gnut @@ -107,6 +107,12 @@ void function AnimateBuddy( entity buddy ) buddy.WaitSignal( "fastball_release" ) wait 5.0 + + // clear any players off bt to avoid potential crash which can supposedly happen even though i've never seen it happen + foreach ( entity player in GetPlayerArray() ) + if ( player.GetParent() == buddy ) + player.ClearParent() + buddy.Destroy() } diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut index 1feefc2b..02be47a4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_menu_callbacks.gnut @@ -35,7 +35,8 @@ void function WritePersistenceAndLeaveForLocalPlayerOnly( entity player ) while ( GetPlayerArray().len() != 1 && Time() < time + 5.0 ) WaitFrame() - WritePersistenceAndLeave( player ) + if ( IsValid( player ) ) + WritePersistenceAndLeave( player ) } void function WritePersistenceAndLeave( entity player ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut index efaea76f..3151a0f2 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut @@ -242,7 +242,17 @@ void function PlayerUsesAmpedWeaponsBurncardThreaded( entity player ) { weapon.RemoveMod( "silencer" ) // both this and the burnmod will override firing fx, if a second one overrides this we crash foreach ( string mod in GetWeaponBurnMods( weapon.GetWeaponClassName() ) ) - weapon.AddMod( mod ) + { + // catch incompatibilities just in case + try + { + weapon.AddMod( mod ) + } + catch( ex ) + { + weapons.removebyvalue( weapon ) + } + } // needed to display amped weapon time left weapon.SetScriptFlags0( weapon.GetScriptFlags0() | WEAPONFLAG_AMPED ) -- cgit v1.2.3