ACE3/addons/logistics_wirecutter/functions/fnc_isFence.sqf

33 lines
808 B
Plaintext
Raw Normal View History

/*
* Author: PabstMirror
* Checks if object is a fence. Should work on any fence type, even when (typeOf == "").
* Call is fairly expensive because of string checking.
*
* Arguments:
* 0: Object to test <OBJECT>
*
* Return Value:
* Is fence <BOOL>
*
* Example:
* [cursorObject] call ace_logistics_wirecutter_fnc_isFence
*
* Public: No
*/
2015-01-28 09:22:39 +00:00
#include "script_component.hpp"
params ["_object"];
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 {
// 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 {
// 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