2015-03-10 21:01:46 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2018-07-13 16:30:13 +00:00
|
|
|
* Checks if object is a fence. Should work on any fence type, even when (typeOf == "").
|
|
|
|
* Call is fairly expensive because of string checking.
|
2015-03-10 21:01:46 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2018-07-13 16:30:13 +00:00
|
|
|
* 0: Object to test <OBJECT>
|
2015-03-10 21:01:46 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2018-07-13 16:30:13 +00:00
|
|
|
* Is fence <BOOL>
|
2015-03-10 21:01:46 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2018-07-13 16:30:13 +00:00
|
|
|
* [cursorObject] call ace_logistics_wirecutter_fnc_isFence
|
2015-03-10 21:01:46 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-28 09:22:39 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-23 23:39:08 +00:00
|
|
|
params ["_object"];
|
2018-07-13 16:30:13 +00:00
|
|
|
TRACE_1("Checking if fence",_object);
|
2015-01-28 09:22:39 +00:00
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _typeOf = typeOf _object;
|
2015-01-28 09:22:39 +00:00
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _returnValue = if (_typeOf != "") then {
|
2018-07-13 16:30:13 +00:00
|
|
|
// Check for isFence entry since we have valid typeOf
|
|
|
|
1 == getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence));
|
2015-01-28 09:22:39 +00:00
|
|
|
} else {
|
2018-07-13 16:30:13 +00:00
|
|
|
// Check the p3d name against list (in script_component.hpp)
|
|
|
|
(getModelInfo _object select 0) in FENCE_P3DS;
|
2015-01-28 09:22:39 +00:00
|
|
|
};
|
2015-01-28 17:51:42 +00:00
|
|
|
|
2015-01-28 09:22:39 +00:00
|
|
|
_returnValue
|