Fix facility is like vehicle (#6478)

This commit is contained in:
Dystopian 2018-08-06 19:27:14 +03:00 committed by PabstMirror
parent d31f004ac2
commit 2d5892f285

View File

@ -21,19 +21,22 @@ TRACE_1("params",_object);
private _position = getPosASL _object;
private _isInBuilding = false;
private _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]);
{
if (_x getVariable ["ACE_isRepairFacility", getNumber (configFile >> "CfgVehicles" >> typeOf _x >> QGVAR(canRepair))] > 0) exitWith {
private _checkObject = {
if (
_x getVariable ["ACE_isRepairFacility", getNumber (configFile >> "CfgVehicles" >> typeOf _x >> QGVAR(canRepair))] > 0
&& {!(_x isKindOf "AllVehicles")} // check if it's not repair vehicle
&& {alive _x}
) exitWith {
_isInBuilding = true;
};
} forEach _objects;
if (!_isInBuilding) then {
_objects = position _object nearObjects 7.5;
{
if (_x getVariable ["ACE_isRepairFacility", getNumber (configFile >> "CfgVehicles" >> typeOf _x >> QGVAR(canRepair))] > 0) exitWith {
_isInBuilding = true;
};
} forEach _objects;
};
_isInBuilding;
private _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]);
_checkObject forEach _objects;
if (_isInBuilding) exitWith {true};
_objects = position _object nearObjects 7.5;
_checkObject forEach _objects;
_isInBuilding