aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts
diff options
context:
space:
mode:
authorDinorush <62536724+Dinorush@users.noreply.github.com>2024-07-06 17:30:01 -0400
committerGitHub <noreply@github.com>2024-07-06 23:30:01 +0200
commitf3fa134ff6508f88cf966b92f6690b6f8b58fea1 (patch)
tree3e6f461b3ce5c7b1547bf22d4e359d5ca9fa85f5 /Northstar.Custom/mod/scripts/vscripts
parent0198d3f99c40ab641c85fff62b62276407e0dfc3 (diff)
downloadNorthstarMods-f3fa134ff6508f88cf966b92f6690b6f8b58fea1.tar.gz
NorthstarMods-f3fa134ff6508f88cf966b92f6690b6f8b58fea1.zip
Fix `cl_earn_meter` crash when Core does not exist during Core Active state (#494)
Fix crash when getting core weapon
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut6
1 files changed, 5 insertions, 1 deletions
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 16908362..3971d2be 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<string> coreMods = core.GetMods()