2015-03-10 21:01:46 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
|
|
|
* Checks if object is a fence. Should work on any fence type, even (typeof == "").
|
|
|
|
* Call is fairly expensive because of all of the string checking.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: An Object To Test <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Is it a fence <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [aFence] call ace_logistics_wirecutter_fnc_isFence
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-28 09:22:39 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-23 23:39:08 +00:00
|
|
|
params ["_object"];
|
|
|
|
TRACE_1("params",_object);
|
2015-01-28 09:22:39 +00:00
|
|
|
|
|
|
|
private ["_typeOf", "_returnValue"];
|
|
|
|
|
2015-08-24 03:55:43 +00:00
|
|
|
_typeOf = typeOf _object;
|
2015-01-28 09:22:39 +00:00
|
|
|
_returnValue = false;
|
|
|
|
|
|
|
|
if (_typeOf != "") then {
|
2015-04-15 23:32:47 +00:00
|
|
|
//If the fence has configEntry we can check it directly
|
2015-08-23 23:39:08 +00:00
|
|
|
_returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
|
2015-01-28 09:22:39 +00:00
|
|
|
} else {
|
2015-08-23 23:39:08 +00:00
|
|
|
//TODO: 1.50 use getModelInfo
|
2015-03-10 21:01:46 +00:00
|
|
|
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
|
|
|
|
{
|
2015-04-15 23:32:47 +00:00
|
|
|
if ((_typeOf find _x) != -1) exitWith {
|
2015-03-10 21:01:46 +00:00
|
|
|
_returnValue = true;
|
|
|
|
};
|
2015-08-23 23:39:08 +00:00
|
|
|
nil
|
|
|
|
} count 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
|