From decad3f2da1ad75779171ad3e20a1b9dde4d4b50 Mon Sep 17 00:00:00 2001 From: spencershepard Date: Sat, 20 Jul 2024 12:02:44 -0700 Subject: [PATCH] fix issues with static despawning --- scripts/RotorOpsPerks.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/RotorOpsPerks.lua b/scripts/RotorOpsPerks.lua index 3e3b3fe..909c637 100644 --- a/scripts/RotorOpsPerks.lua +++ b/scripts/RotorOpsPerks.lua @@ -55,7 +55,7 @@ RotorOpsPerks.player_fatcow_types = { RotorOpsPerks.static_helicopters_at_farp = true --spawn static helicopters at the FARP if player reslots RotorOpsPerks.static_helicopter_types = { --mapping of player helicopters to their static equivalents - ["UH-60L"] = "UH-60L", + ["UH-60L"] = "UH-60A", ["Mi-8MT"] = "Mi-8MT", --insert CH-47 here! } @@ -1012,6 +1012,10 @@ function RotorOpsPerks.despawnStaticHelicopter(farp_index) if farp.static_heli_name then log('Despawning static helicopter ' .. farp.static_heli_name) local unit = StaticObject.getByName(farp.static_heli_name) + if not unit then + log('Static helicopter not found: ' .. farp.static_heli_name, 'error') + return false + end local sphere = { point = unit:getPosition().p, radius = 20