diff options
author | Dinorush <62536724+Dinorush@users.noreply.github.com> | 2024-07-06 17:30:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-06 23:30:01 +0200 |
commit | f3fa134ff6508f88cf966b92f6690b6f8b58fea1 (patch) | |
tree | 3e6f461b3ce5c7b1547bf22d4e359d5ca9fa85f5 /Northstar.Custom | |
parent | 0198d3f99c40ab641c85fff62b62276407e0dfc3 (diff) | |
download | NorthstarMods-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')
-rw-r--r-- | Northstar.Custom/mod/scripts/vscripts/earn_meter/cl_earn_meter.gnut | 6 |
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() |