From d70c049b4f924400af5385acfe5842305e9c4132 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 18 Oct 2023 21:17:07 -0500 Subject: [PATCH] CSW/Dragging - Handle null objects causing script errors (#9529) * CSW - Handle static weapon be deleted * add same fix to dragging --- addons/csw/functions/fnc_staticWeaponInit.sqf | 1 + addons/dragging/functions/fnc_initPerson.sqf | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/csw/functions/fnc_staticWeaponInit.sqf b/addons/csw/functions/fnc_staticWeaponInit.sqf index 3b1d7ef66e..fcef5df08e 100644 --- a/addons/csw/functions/fnc_staticWeaponInit.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit.sqf @@ -16,6 +16,7 @@ */ params ["_staticWeapon"]; +if (isNull _staticWeapon) exitWith { WARNING_1("%1 became null",_staticWeapon) }; private _typeOf = typeOf _staticWeapon; private _configOf = configOf _staticWeapon; private _configEnabled = (getNumber (_configOf >> "ace_csw" >> "enabled")) == 1; diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf index fd166cfab9..6ac2b5d569 100644 --- a/addons/dragging/functions/fnc_initPerson.sqf +++ b/addons/dragging/functions/fnc_initPerson.sqf @@ -16,6 +16,7 @@ */ params ["_unit"]; +if (isNull _unit) exitWith { WARNING_1("%1 became null",_unit) }; [_unit, true, [0, 1.1, 0.092], 180] call FUNC(setDraggable); [_unit, true, [0.4, -0.1, -1.25], 195] call FUNC(setCarryable); // Hard-coded selection: "LeftShoulder"