Sarge-AI/sarge/UPSMON/COMMON/buildings/fnc/UPSMON_gethighestbldpos.sqf
Teh Dango 7067ad9b0a 2.2.3
Check the change log for details
2016-08-18 22:58:49 -04:00

32 lines
658 B
Plaintext

/****************************************************************
File: UPSMON_gethighestbldpos.sqf
Author: Azroul13
Description:
Get the highest point of the building
Parameter(s):
<--- Array of building positions
Returns:
Number
****************************************************************/
private ["_bldpos","_result","_zbldposs","_lastzbldpos"];
_bldpos = _this select 0;
_result = 0;
_zbldposs = [];
_lastzbldpos = 0;
{
_zbldposs = _zbldposs + [_x select 2];
} foreach _bldpos;
{
_zblpos = _x;
If (_zblpos > _lastzbldpos) then {_result = _zblpos;} else {_result = _lastzbldpos;};
_lastzbldpos = _x;
} foreach _zbldposs;
_result;