mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
only setdamage 0 if building has UID or ID
This commit is contained in:
@@ -12,16 +12,16 @@ if (_option == 1) then {
|
|||||||
_objects = nearestObjects [_targetObj, DZE_maintainClasses, DZE_maintainRange];
|
_objects = nearestObjects [_targetObj, DZE_maintainClasses, DZE_maintainRange];
|
||||||
{
|
{
|
||||||
if (damage _x >= 0.1) then {
|
if (damage _x >= 0.1) then {
|
||||||
// repair object also removes maintain option
|
|
||||||
_x setDamage 0;
|
|
||||||
_objectID = _x getVariable ["ObjectID","0"];
|
_objectID = _x getVariable ["ObjectID","0"];
|
||||||
if (_objectID == "0") then {
|
if (_objectID == "0") then {
|
||||||
_objectUID = _x getVariable ["ObjectUID","0"];
|
_objectUID = _x getVariable ["ObjectUID","0"];
|
||||||
if (_objectUID != "0") then {
|
if (_objectUID != "0") then {
|
||||||
|
_x setDamage 0;
|
||||||
_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0"
|
_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0"
|
||||||
_key call server_maintainObj;
|
_key call server_maintainObj;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
_x setDamage 0;
|
||||||
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
||||||
_key call server_maintainObj;
|
_key call server_maintainObj;
|
||||||
};
|
};
|
||||||
@@ -36,12 +36,15 @@ if (_option == 2) then {
|
|||||||
if (_objectID == "0") then {
|
if (_objectID == "0") then {
|
||||||
_objectUID = _targetObj getVariable ["ObjectUID","0"];
|
_objectUID = _targetObj getVariable ["ObjectUID","0"];
|
||||||
if (_objectUID != "0") then {
|
if (_objectUID != "0") then {
|
||||||
|
_targetObj setDamage 0;
|
||||||
_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0"
|
_key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0"
|
||||||
_key call server_maintainObj;
|
_key call server_maintainObj;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
_targetObj setDamage 0;
|
||||||
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
_key = format["CHILD:396:%1:", _objectID]; //Use ID instead of UID because ID is shorter
|
||||||
_key call server_maintainObj;
|
_key call server_maintainObj;
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user