Merge pull request #2781 from acemod/updateWirecutters

Wirecutters - Update Fence Configs, Use faster getModelInfo
This commit is contained in:
PabstMirror 2015-11-04 13:17:15 -06:00
commit 39d4383a04
3 changed files with 12 additions and 21 deletions

View File

@ -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; };
};

View File

@ -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;

View File

@ -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