-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
James Kingsley
committed
Oct 2, 2016
1 parent
76a3557
commit adabf59
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Author: commy2, Kingsley | ||
* Check if the position is in a building. Will return true if the position is in a bush. | ||
* | ||
* Arguments: | ||
* 0: Position <ARRAY> | ||
* | ||
* Return Value: | ||
* Is the position in a building? <BOOL> | ||
* | ||
* Example: | ||
* [getPos myUnit] call f_fnc_inBuilding; | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
#define CHECK_DISTANCE 15 | ||
|
||
params [["_position", []]]; | ||
|
||
if (_position isEqualTo []) exitWith {}; | ||
|
||
private _intersections = { | ||
lineIntersects [_position, _position vectorAdd _x] | ||
} count [ | ||
[0, 0, +CHECK_DISTANCE], | ||
[+CHECK_DISTANCE, 0, 0], | ||
[-CHECK_DISTANCE, 0, 0], | ||
[0, +CHECK_DISTANCE, 0], | ||
[0, -CHECK_DISTANCE, 0] | ||
]; | ||
|
||
_intersections > 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters