ACE3/addons/logistics_wirecutter/functions/fnc_isFence.sqf

29 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-01-28 09:22:39 +00:00
#include "script_component.hpp"
2015-01-28 17:51:42 +00:00
//find is case sensitive, so keep everything lowercase
#define FENCE_A3_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"]
#define FENCE_A3_P3DS ["mil_wiredfence_f.p3d"]
#define FENCE_AIA_TYPENAMES []
#define FENCE_AIA_P3DS ["wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
2015-01-28 09:22:39 +00:00
private ["_typeOf", "_returnValue"];
PARAMS_1(_object);
_typeOf = typeOf _object;
_returnValue = false;
if (_typeOf != "") then {
2015-01-28 17:51:42 +00:00
_returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES);
2015-01-28 09:22:39 +00:00
} else {
2015-01-28 17:51:42 +00:00
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
2015-01-28 09:22:39 +00:00
{
if ((_typeOf find _x) != -1) then {
_returnValue = true;
};
2015-01-28 17:51:42 +00:00
} forEach (FENCE_A3_P3DS + FENCE_AIA_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