forked from CBATeam/CBA_A3
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfnc_isTerrainObject.sqf
More file actions
30 lines (22 loc) · 875 Bytes
/
fnc_isTerrainObject.sqf
File metadata and controls
30 lines (22 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "script_component.hpp"
/* ----------------------------------------------------------------------------
Function: CBA_fnc_isTerrainObject
Description:
Check if object is a terrain object.
Parameters:
_object - any object <OBJECT>
Returns:
true for terrain objects, false otherwise <BOOLEAN>
Examples:
(begin example)
cursorObject call CBA_fnc_isTerrainObject
(end)
Author:
commy2
---------------------------------------------------------------------------- */
SCRIPT(isTerrainObject);
params [["_object", objNull, [objNull]]];
if (isNull _object) exitWith { false };
// Terrain objects always have an owner of 1, but `owner` command is server exec. So we just check first character of netId
// They also have a negative netId, but Dedmen said not to rely on it in the case that BI fixes it
(netId _object) select [0, 1] == "1"