From 67611e7fad615b33db8c4751b3e61ff44a630071 Mon Sep 17 00:00:00 2001 From: Connie Price Date: Tue, 28 Dec 2021 18:26:54 +0000 Subject: Fixed the game erroring when disembarking from a titan and the player has a weapon missing "menu_category" equipped (like titan weapons). --- .../mod/scripts/vscripts/mp/_titan_transfer.nut | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Northstar.CustomServers/mod/scripts') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_titan_transfer.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_titan_transfer.nut index 7b126cd0..c84e6aba 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_titan_transfer.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_titan_transfer.nut @@ -178,7 +178,12 @@ void function GiveWeaponsFromStoredArray( entity player, array sto UpdateProScreen( player, weapon ) } - string weaponCategory = GetWeaponInfoFileKeyField_GlobalString( weapon.GetWeaponClassName(), "menu_category" ) + string weaponCategory = "" + if ( IsWeaponKeyFieldDefined(weapon.GetWeaponClassName(), "menu_category") ) + { + weaponCategory = GetWeaponInfoFileKeyField_GlobalString( weapon.GetWeaponClassName(), "menu_category" ) + } + if ( weaponCategory == "at" || weaponCategory == "special" ) // refill AT/grenadier ammo stockpile { int defaultTotal = weapon.GetWeaponSettingInt( eWeaponVar.ammo_default_total ) -- cgit v1.2.3