From f3fa134ff6508f88cf966b92f6690b6f8b58fea1 Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Sat, 6 Jul 2024 17:30:01 -0400 Subject: [PATCH] Fix `cl_earn_meter` crash when Core does not exist during Core Active state (#494) Fix crash when getting core weapon --- .../mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut b/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut index 16908362c..3971d2bec 100644 --- a/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut @@ -335,7 +335,11 @@ void function EarnMeter_Update() break entity soul = player.GetTitanSoul() - entity core = player.GetOffhandWeapons()[3] + entity core = player.GetOffhandWeapon( OFFHAND_EQUIPMENT ) + + if ( !IsValid( core ) ) + break + string coreName = core.GetWeaponClassName() array coreMods = core.GetMods()