mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Common - Fix calling getVar on null object in canInteractWith
(#8532)
* Common - Fix calling getVar on null object in `canInteractWith` * why was this added dedman?
This commit is contained in:
parent
2dfbaa90b0
commit
a0e9f6015b
@ -21,10 +21,11 @@ params ["_unit", "_target", ["_exceptions", []]];
|
||||
|
||||
_exceptions = _exceptions apply {toLower _x};
|
||||
|
||||
private _owner = _target getVariable [QGVAR(owner), objNull];
|
||||
|
||||
// exit if the target is not free to interact
|
||||
if (!isNull _owner && {_unit != _owner}) exitWith {false};
|
||||
if ((!isNull _target) && {
|
||||
private _owner = _target getVariable [QGVAR(owner), objNull];
|
||||
(!isNull _owner) && {_unit != _owner}}
|
||||
) exitWith {false};
|
||||
|
||||
// check general conditions
|
||||
private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]];
|
||||
|
@ -23,7 +23,9 @@ if (isNull _unit) exitWith {};
|
||||
private _virtualLoad = 0;
|
||||
|
||||
{
|
||||
_virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]);
|
||||
if (!isNull _x) then {
|
||||
_virtualLoad = _virtualLoad + (_x getVariable [QGVAR(vLoad), 0]);
|
||||
};
|
||||
} forEach [
|
||||
_unit,
|
||||
uniformContainer _unit,
|
||||
|
Loading…
Reference in New Issue
Block a user