Advertisement
X39

isUnitInShelter (teil von zukünftigem XLib update)

X39
May 3rd, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. /**
  2. * !FUNCTION IS NOT CALLSAFE!
  3. * checks if a unit is inside of a BoundingBox of a house
  4. *
  5. * @ParamsCount - 1
  6. * @Param1 - OBJECT - unit to check
  7. * @Return - BOOL - true if unit has shelter, false if not
  8. * @Author - X39|Cpt. HM Murdock
  9. */
  10. private["_unit", "_house", "_BB", "_BB1", "_BB2"];
  11. _unit = _this select 0;
  12. _house = nearestBuilding _unit;
  13. _BB = boundingBoxReal _house;
  14. _BB1 = _house modelToWorld (_BB select 0);
  15. _BB2 = _house modelToWorld (_BB select 1);
  16. ( (position _unit select 0 < _BB1 select 0 && position _unit select 01 < _BB1 select 1 && position _unit select 2 > _BB1 select 2) &&
  17. (position _unit select 0 > _BB2 select 0 && position _unit select 01 > _BB2 select 1 && position _unit select 2 < _BB2 select 2) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement