Sarge-AI/ModName.MapName/scripts/UPSMON/COMMON/buildings/fnc/UPSMON_Isroof.sqf
Teh Dango 65e4453908 2.4.0
Major Update. Now supporting DesolationRedux, Epoch and Exile.
2017-12-31 03:16:37 -05:00

26 lines
596 B
Plaintext

/****************************************************************
File: UPSMON_Isroof.sqf
Author: Azroul13
Description:
Check if the AI is under a roof.
Parameter(s):
<--- Unit
Returns:
boolean
****************************************************************/
private ["_Inbuilding","_Roof","_unit"];
_unit = _this select 0;
_Inbuilding = false;
_Roof = lineIntersectsWith [getposASL _unit, [((getposASL _unit) select 0), ((getposASL _unit) select 1), ((getposASL _unit) select 2) + 20]];
If (count _Roof > 0) then
{
_Inbuilding = (_Roof select 0) isKindOf "BUILDING";
};
_Inbuilding