ACE3/addons/logistics_wirecutter/script_component.hpp
Will 05c9e4247b
Logistics Wirecutter - Add modded class support (#9235)
* Update script_component.hpp

Change check for wire cutters for all child classes in addition to current class

* Update script_component.hpp

fix bracket

* Change isKindOf for alt syntax

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/logistics_wirecutter/script_component.hpp

Better performing searching for wirecutter

Co-authored-by: BrettMayson <brett@mayson.io>

* Update XEH_postInit.sqf

Index all possible wirecutters

* Update script_component.hpp

arrayIntersect with possible wirecutters

* Update XEH_postInit.sqf

Incorrect quotes

* Update CfgWeapons.hpp

Add iswirecutter to wirecutter

* Update XEH_postInit.sqf

Remove pointless parentheses

* Update addons/logistics_wirecutter/script_component.hpp

fix for incorrect arrayintersect check

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update addons/logistics_wirecutter/XEH_postInit.sqf

Incorrect quoting

Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>

* use configClasses and cache at preStart

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: BrettMayson <brett@mayson.io>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
Co-authored-by: Jouni Järvinen <rautamiekka@users.noreply.github.com>
2023-07-09 19:37:30 +03:00

95 lines
2.9 KiB
C++

#define COMPONENT logistics_wirecutter
#define COMPONENT_BEAUTIFIED Logistics Wire Cutter
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_LOGISTICS_WIRECUTTER
#define DEBUG_SETTINGS DEBUG_SETTINGS_LOGISTICS_WIRECUTTER
#endif
#include "\z\ace\addons\main\script_macros.hpp"
// find is case sensitive, so keep everything lowercase
// also set as isFence, but if the model is reused like for xcam
#define FENCE_P3DS [\
"net_fence_4m_f.p3d",\
"net_fence_8m_f.p3d",\
"netfence_01_m_4m_f.p3d",\
"netfence_01_m_8m_f.p3d",\
"wired_fence_4m_f.p3d",\
"wired_fence_8m_f.p3d",\
"new_wiredfence_5m_f.p3d",\
"new_wiredfence_10m_f.p3d",\
"wiredfence_01_4m_f.p3d",\
"wiredfence_01_8m_f.p3d",\
"wiredfence_01_16m_f.p3d",\
"mil_wiredfence_f.p3d",\
"sportground_fence_f.p3d",\
"sportground_fence_nolc_f.p3d",\
"indfnc_3_f.p3d",\
"indfnc_3_hole_f.p3d",\
"indfnc_9_f.p3d",\
"indfnc_corner_f.p3d",\
"slums01_8m.p3d",\
"razorwire_f.p3d",\
"slums02_4m.p3d",\
"backalley_01_l_1m_f.p3d",\
"plasticnetfence_01_short_f.p3d",\
"plasticnetfence_01_long_f.p3d",\
"wall_indfnc_3.p3d",\
"wall_indfnc_9.p3d",\
"wall_indfnc_corner.p3d",\
"pletivo_wired.p3d",\
"wall_fen1_5.p3d",\
"plot_provizorni.p3d",\
"plp_ctm_partitioningfencegrey.p3d",\
"fence.p3d",\
"fort_razorwire.p3d",\
"barbedwire.pd3",\
"dd_pletivo.p3d",\
"plot_green_draty.p3d",\
"plot_rust_draty.p3d",\
"wall_fen1_5_2.p3d",\
"gm_fence_border_gssz_70_600.p3d",\
"gm_fence_border_gssz_70_gate_350_r.p3d",\
"gm_fence_border_gssz_70_gate_350_w.p3d",\
"gm_fence_border_gz1_600.p3d",\
"gm_fence_border_gz1_gate_350_r.p3d",\
"gm_fence_border_gz1_gate_350_w.p3d",\
"gm_fence_wirefence_01_01.p3d",\
"gm_fence_wirefence_01_02.p3d",\
"gm_fence_wirefence_01_03.p3d",\
"gm_gc_g501_sm70_01.p3d",\
"gm_gc_g501_sm70_02.p3d",\
"gm_gc_g501_sm70_03.p3d",\
"netfence_03_m_3m_f.p3d",\
"netfence_03_m_3m_hole_f.p3d",\
"netfence_03_m_3m_corner_f.p3d",\
"netfence_03_m_9m_f.p3d",\
"vineyardfence_01_f.p3d",\
"gameprooffence_01_l_5m_f.p3d",\
"netfence_01_m_gate_f.p3d",\
"netfence_02_m_2m_f.p3d",\
"netfence_02_m_4m_f.p3d",\
"netfence_02_m_8m_f.p3d",\
"net_fence_gate_f.p3d",\
"new_wiredfence_10m_dam_f.p3d"\
]
#define SOUND_CLIP_TIME_SPACING 1.5
#define CUT_TIME_DEFAULT 11
#define CUT_TIME_ENGINEER 7.5
#define HAS_WIRECUTTER(unit) (\
((unit call EFUNC(common,uniqueItems)) arrayIntersect GVAR(possibleWirecutters)) isNotEqualTo []\
|| {getNumber ((configOf (backpackContainer unit)) >> QGVAR(hasWirecutter)) == 1} \
|| {getNumber (configFile >> "CfgWeapons" >> (vest unit) >> QGVAR(hasWirecutter)) == 1} \
)