From e340f5164c6a8a566e386a16a6c7f1c00ab572b6 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 22 Oct 2015 20:54:09 -0500 Subject: [PATCH] Wirecutters - Update Fence Configs, Use faster getModelInfo --- addons/logistics_wirecutter/CfgVehicles.hpp | 12 ++++++------ .../functions/fnc_interactEH.sqf | 2 +- .../functions/fnc_isFence.sqf | 19 +++++-------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp index 0b584409d3..d9c2943d45 100644 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -11,16 +11,16 @@ class CfgVehicles { class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; }; class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; }; class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; }; class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; - class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_SportGround_fence_noLC_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Mil_WiredFence_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_Corner_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_9_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_3_Hole_F: Wall_F { GVAR(isFence) = 1; }; + class Land_IndFnc_3_F: Wall_F { GVAR(isFence) = 1; }; class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; }; diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index e93296e44a..e28ff17db6 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -56,7 +56,7 @@ TRACE_1("Starting wire-cut action PFEH",_interactionType); if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); - _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); + _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, {[0,0,0]}, 5.5] call EFUNC(interact_menu,createAction); [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); _addedHelpers pushBack _helper; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index c1e30a7e6f..449ffd7b77 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -19,23 +19,14 @@ params ["_object"]; TRACE_1("params",_object); -private ["_typeOf", "_returnValue"]; +local _typeOf = typeOf _object; -_typeOf = typeOf _object; -_returnValue = false; - -if (_typeOf != "") then { +local _returnValue = if (_typeOf != "") then { //If the fence has configEntry we can check it directly - _returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); + (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); } else { - //TODO: 1.50 use getModelInfo - _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" - { - if ((_typeOf find _x) != -1) exitWith { - _returnValue = true; - }; - nil - } count FENCE_P3DS; + //Check the p3d name against list (in script_component.hpp) + ((getModelInfo _object) select 0) in FENCE_P3DS; }; _returnValue