mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Fix undefined error when trap is deleted
Getvariable returns undefined if the object is null. https://community.bistudio.com/wiki/getVariable
This commit is contained in:
@@ -373,10 +373,14 @@ publicVariable "sm_done";
|
|||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
if (isNull _x) then {dayz_traps = dayz_traps - [_x];};
|
if (isNull _x) then {
|
||||||
|
dayz_traps = dayz_traps - [_x];
|
||||||
_script = call compile getText (configFile >> "CfgVehicles" >> typeOf _x >> "script");
|
_armed = false;
|
||||||
_armed = _x getVariable ["armed", false];
|
_script = {};
|
||||||
|
} else {
|
||||||
|
_armed = _x getVariable ["armed", false];
|
||||||
|
_script = call compile getText (configFile >> "CfgVehicles" >> typeOf _x >> "script");
|
||||||
|
};
|
||||||
|
|
||||||
if (_armed) then {
|
if (_armed) then {
|
||||||
if !(_x in dayz_traps_active) then {["arm", _x] call _script;};
|
if !(_x in dayz_traps_active) then {["arm", _x] call _script;};
|
||||||
|
|||||||
Reference in New Issue
Block a user