#731 - stop error if target offscreen

This commit is contained in:
PabstMirror 2015-04-17 22:02:23 -05:00
parent b32a2b7495
commit 71e62711c6

View File

@ -40,12 +40,13 @@ if (true) then {
{
_ppos = worldToScreen (_object modelToWorld _x);
_pposX = _ppos select 0;
_pposY = _ppos select 1;
if (_pposX < _minX) then {_minX = _pposX};
if (_pposX > _maxX) then {_maxX = _pposX};
if (_pposY < _minY) then {_minY = _pposY};
if (_pposY > _maxY) then {_maxY = _pposY};
if (count _ppos >= 2) then {
EXPLODE_2_PVT(_ppos,_pposX,_pposY);
if (_pposX < _minX) then {_minX = _pposX};
if (_pposX > _maxX) then {_maxX = _pposX};
if (_pposY < _minY) then {_minY = _pposY};
if (_pposY > _maxY) then {_maxY = _pposY};
}; //else - what to do if it is offscreen?
} forEach _boundsCorners;
};