Skip to content

Commit

Permalink
CSW/Dragging - Handle null objects causing script errors (acemod#9529)
Browse files Browse the repository at this point in the history
* CSW - Handle static weapon be deleted

* add same fix to dragging
  • Loading branch information
PabstMirror authored Oct 19, 2023
1 parent 902e365 commit d70c049
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions addons/csw/functions/fnc_staticWeaponInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions addons/dragging/functions/fnc_initPerson.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d70c049

Please sign in to comment.