Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSW/Dragging - Handle null objects causing script errors #9529

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"