From 33203289e0cf90ba33c2f670dc809306fb7d4b81 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 31 Mar 2024 23:42:44 -0500 Subject: [PATCH 1/8] Casing - Move model lookup to cartridge config --- addons/casings/CfgVehicles.hpp | 39 +++++++++++++++++++ addons/casings/config.cpp | 1 + addons/casings/functions/fnc_createCasing.sqf | 28 +++---------- addons/compat_cup_weapons/CfgVehicles.hpp | 10 +++++ addons/compat_cup_weapons/config.cpp | 3 +- addons/compat_ws/CfgVehicles.hpp | 15 +++++++ addons/compat_ws/config.cpp | 1 + 7 files changed, 74 insertions(+), 23 deletions(-) create mode 100644 addons/casings/CfgVehicles.hpp create mode 100644 addons/compat_cup_weapons/CfgVehicles.hpp create mode 100644 addons/compat_ws/CfgVehicles.hpp diff --git a/addons/casings/CfgVehicles.hpp b/addons/casings/CfgVehicles.hpp new file mode 100644 index 00000000000..893d4e8e9fd --- /dev/null +++ b/addons/casings/CfgVehicles.hpp @@ -0,0 +1,39 @@ +class CfgVehicles { + class ThingEffect; + class FxCartridge_Small: ThingEffect { + GVAR(model) = "A3\Weapons_f\ammo\cartridge_small.p3d"; + }; + class FxCartridge: ThingEffect { + GVAR(model) = "A3\Weapons_f\ammo\cartridge.p3d"; + }; + class FxCartridge_65: FxCartridge { + GVAR(model) = "A3\weapons_f\ammo\cartridge_65.p3d"; + }; + class FxCartridge_65_caseless: FxCartridge { + GVAR(model) = ""; + }; + class FxCartridge_762: FxCartridge { + GVAR(model) = "A3\weapons_f\ammo\cartridge_762.p3d"; + }; + class FxCartridge_762x39: FxCartridge { + GVAR(model) = "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d"; + }; + class FxCartridge_93x64_Ball: FxCartridge { + GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d"; + }; + class FxCartridge_338_Ball: FxCartridge { + GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d"; + }; + class FxCartridge_338_NM_Ball: FxCartridge { + GVAR(model) ="A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" + }; + class FxCartridge_127: FxCartridge { + GVAR(model) = "A3\weapons_f\ammo\cartridge_127.p3d"; + }; + class FxCartridge_127x54_APDS: FxCartridge { + GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" + }; + class FxCartridge_slug: FxCartridge { + GVAR(model) = "A3\weapons_f\ammo\cartridge_slug.p3d"; + }; +}; diff --git a/addons/casings/config.cpp b/addons/casings/config.cpp index 815048a0827..29d0b7cb89c 100644 --- a/addons/casings/config.cpp +++ b/addons/casings/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index 22347d36a72..dce99fc7e95 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -20,31 +20,15 @@ params ["_unit", "", "", "", "_ammo"]; if (!isNull objectParent _unit) exitWith {}; -private _modelPath = GVAR(cachedCasings) get _ammo; -if (isNil "_modelPath") then { +private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { private _cartridge = getText (configFile >> "CfgAmmo" >> _ammo >> "cartridge"); - //Default cartridge is a 5.56mm model - _modelPath = switch (_cartridge) do { - case "FxCartridge_9mm": { "A3\Weapons_f\ammo\cartridge_small.p3d" }; - case "FxCartridge_65": { "A3\weapons_f\ammo\cartridge_65.p3d" }; - case "FxCartridge_762": { "A3\weapons_f\ammo\cartridge_762.p3d" }; - case "FxCartridge_762x39": { "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d" }; - case "FxCartridge_93x64_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d" }; - case "FxCartridge_338_Ball": { "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d" }; - case "FxCartridge_338_NM": { "A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" }; - case "FxCartridge_127": { "A3\weapons_f\ammo\cartridge_127.p3d" }; - case "FxCartridge_127x54": { "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" }; - case "FxCartridge_slug": { "A3\weapons_f\ammo\cartridge_slug.p3d" }; - case "FxCartridge_12Gauge_HE_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d" }; - case "FxCartridge_12Gauge_Slug_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d" }; - case "FxCartridge_12Gauge_Smoke_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d" }; - case "FxCartridge_12Gauge_Pellet_lxWS": { "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d" }; - case "": { "" }; - default { "A3\Weapons_f\ammo\cartridge.p3d" }; + if (_cartridge == "") then { // return (note: can't use exitWith) + "" + } else { + getText (configFile >> "CfgVehicles" >> _cartridge >> QGVAR(model)) }; - GVAR(cachedCasings) set [_ammo, _modelPath]; -}; +}]; if (_modelPath isEqualTo "") exitWith {}; diff --git a/addons/compat_cup_weapons/CfgVehicles.hpp b/addons/compat_cup_weapons/CfgVehicles.hpp new file mode 100644 index 00000000000..ab2655b3dcc --- /dev/null +++ b/addons/compat_cup_weapons/CfgVehicles.hpp @@ -0,0 +1,10 @@ +class CfgVehicles { + class FxCartridge; + class CUP_FxCartridge_545: FxCartridge { + EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge545.p3d"; + }; + class CUP_FxCartridge_939: FxCartridge { + EGVAR(casings,model) ="\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; + }; + // oicw? +}; diff --git a/addons/compat_cup_weapons/config.cpp b/addons/compat_cup_weapons/config.cpp index e5fd0225558..4ce933d4edb 100644 --- a/addons/compat_cup_weapons/config.cpp +++ b/addons/compat_cup_weapons/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; }; +#include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#include "CfgEventHandlers.hpp" diff --git a/addons/compat_ws/CfgVehicles.hpp b/addons/compat_ws/CfgVehicles.hpp new file mode 100644 index 00000000000..4b380a17ed2 --- /dev/null +++ b/addons/compat_ws/CfgVehicles.hpp @@ -0,0 +1,15 @@ +class CfgVehicles { + class FxCartridge; + class FxCartridge_12Gauge_HE_lxWS: FxCartridge { + EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d"; + }; + class FxCartridge_12Gauge_Slug_lxWS: FxCartridge { + EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d"; + }; + class FxCartridge_12Gauge_Smoke_lxWS: FxCartridge { + EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d"; + }; + class FxCartridge_12Gauge_Pellet_lxWS: FxCartridge { + EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d"; + }; +}; diff --git a/addons/compat_ws/config.cpp b/addons/compat_ws/config.cpp index 32a3f6f73cb..745ce1370fe 100644 --- a/addons/compat_ws/config.cpp +++ b/addons/compat_ws/config.cpp @@ -16,3 +16,4 @@ class CfgPatches { }; #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" From 7a1c17c67b60a90b9c700a4636efc0c9254e1b4e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 31 Mar 2024 23:47:58 -0500 Subject: [PATCH 2/8] Update CfgVehicles.hpp --- addons/casings/CfgVehicles.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/casings/CfgVehicles.hpp b/addons/casings/CfgVehicles.hpp index 893d4e8e9fd..9a1439d9e0c 100644 --- a/addons/casings/CfgVehicles.hpp +++ b/addons/casings/CfgVehicles.hpp @@ -25,13 +25,13 @@ class CfgVehicles { GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d"; }; class FxCartridge_338_NM_Ball: FxCartridge { - GVAR(model) ="A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d" + GVAR(model) ="A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d"; }; class FxCartridge_127: FxCartridge { GVAR(model) = "A3\weapons_f\ammo\cartridge_127.p3d"; }; class FxCartridge_127x54_APDS: FxCartridge { - GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d" + GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d"; }; class FxCartridge_slug: FxCartridge { GVAR(model) = "A3\weapons_f\ammo\cartridge_slug.p3d"; From 7471fd4ab3a5f946939616a06cf0aa23e77af3b1 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 1 Apr 2024 09:37:16 -0500 Subject: [PATCH 3/8] =?UTF-8?q?add=20=F0=9F=92=A9=20so=20it=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pboproject.yml | 1 + addons/compat_cup_weapons/CfgVehicles.hpp | 2 +- .../Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d | 0 .../Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d | 0 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d | 0 .../lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d | 0 .../pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d | 0 .../lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d | 0 8 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d create mode 100644 tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d create mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d create mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d create mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d create mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d diff --git a/.github/workflows/pboproject.yml b/.github/workflows/pboproject.yml index 71e36eb12bd..4edd3bfa6ce 100644 --- a/.github/workflows/pboproject.yml +++ b/.github/workflows/pboproject.yml @@ -68,6 +68,7 @@ jobs: xcopy /e /h /q z\ace\tools\pDummies\vn vn\ xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\ xcopy /e /h /q z\ace\tools\pDummies\CUP CUP\ + xcopy /e /h /q z\ace\tools\pDummies\lxWS lxWS\ - name: Build run: py P:\z\ace\tools\make.py ci env: diff --git a/addons/compat_cup_weapons/CfgVehicles.hpp b/addons/compat_cup_weapons/CfgVehicles.hpp index ab2655b3dcc..ca8ad8b01dd 100644 --- a/addons/compat_cup_weapons/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge545.p3d"; }; class CUP_FxCartridge_939: FxCartridge { - EGVAR(casings,model) ="\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; + EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; }; // oicw? }; diff --git a/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d new file mode 100644 index 00000000000..e69de29bb2d From 433365a6b001ebfd3cfb719718ffc7d79a24f699 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 1 Apr 2024 09:42:21 -0500 Subject: [PATCH 4/8] Update fnc_createCasing.sqf --- addons/casings/functions/fnc_createCasing.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index dce99fc7e95..824e0e2a925 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -28,7 +28,7 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { } else { getText (configFile >> "CfgVehicles" >> _cartridge >> QGVAR(model)) }; -}]; +}, true]; if (_modelPath isEqualTo "") exitWith {}; From 935f611ab4e8c573548e20bebf9d0017239d5969 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 5 Apr 2024 22:43:11 -0500 Subject: [PATCH 5/8] Update addons/casings/functions/fnc_createCasing.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/casings/functions/fnc_createCasing.sqf | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index 824e0e2a925..760eeba4528 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -26,7 +26,23 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { if (_cartridge == "") then { // return (note: can't use exitWith) "" } else { - getText (configFile >> "CfgVehicles" >> _cartridge >> QGVAR(model)) + private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge; + private _model = getText (_cartridgeConfig >> QGVAR(model)); + + if (_model == "model") then { + _model = getText (_cartridgeConfig >> "model"); + + if ("a3\weapons_f\empty" in toLowerANSI _model) then { + _model = ""; + }; + }; + + // Add file extension if missing (fileExists needs file extension) + if ((_model select [count _model - 4]) != ".p3d") then { + _model = _model + ".p3d"; + }; + + ["", _model] select (fileExists _model) }; }, true]; From 74c4cf32a878b848e359fa8ac6d8b7f5e2027b9f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 5 Apr 2024 22:44:15 -0500 Subject: [PATCH 6/8] =?UTF-8?q?Revert=20"add=20=F0=9F=92=A9=20so=20it=20bu?= =?UTF-8?q?ilds"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7471fd4ab3a5f946939616a06cf0aa23e77af3b1. --- .github/workflows/pboproject.yml | 1 - addons/compat_cup_weapons/CfgVehicles.hpp | 2 +- .../Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d | 0 .../Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d | 0 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d | 0 .../lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d | 0 .../pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d | 0 .../lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d | 0 8 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d delete mode 100644 tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d delete mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d delete mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d delete mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d delete mode 100644 tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d diff --git a/.github/workflows/pboproject.yml b/.github/workflows/pboproject.yml index 4edd3bfa6ce..71e36eb12bd 100644 --- a/.github/workflows/pboproject.yml +++ b/.github/workflows/pboproject.yml @@ -68,7 +68,6 @@ jobs: xcopy /e /h /q z\ace\tools\pDummies\vn vn\ xcopy /e /h /q z\ace\tools\pDummies\WW2 WW2\ xcopy /e /h /q z\ace\tools\pDummies\CUP CUP\ - xcopy /e /h /q z\ace\tools\pDummies\lxWS lxWS\ - name: Build run: py P:\z\ace\tools\make.py ci env: diff --git a/addons/compat_cup_weapons/CfgVehicles.hpp b/addons/compat_cup_weapons/CfgVehicles.hpp index ca8ad8b01dd..ab2655b3dcc 100644 --- a/addons/compat_cup_weapons/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge545.p3d"; }; class CUP_FxCartridge_939: FxCartridge { - EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; + EGVAR(casings,model) ="\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; }; // oicw? }; diff --git a/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge545.p3d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d b/tools/pDummies/CUP/Weapons/CUP_Weapons_Ammunition/magazines/cartridge939.p3d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_he_lxws.p3d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_pellet_lxws.p3d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_slug_lxws.p3d deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d b/tools/pDummies/lxWS/weapons_1_f_lxws/Ammo/cartridge_smoke_lxws.p3d deleted file mode 100644 index e69de29bb2d..00000000000 From fef0704dd431c9c30967d8232387a5954f0b5485 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 5 Apr 2024 23:04:32 -0500 Subject: [PATCH 7/8] Default use casing's model --- addons/casings/CfgVehicles.hpp | 37 +------------------ addons/casings/functions/fnc_createCasing.sqf | 13 +++---- addons/compat_cup_weapons/CfgVehicles.hpp | 10 ----- addons/compat_cup_weapons/config.cpp | 1 - addons/compat_ws/CfgVehicles.hpp | 15 -------- addons/compat_ws/config.cpp | 1 - 6 files changed, 8 insertions(+), 69 deletions(-) delete mode 100644 addons/compat_cup_weapons/CfgVehicles.hpp delete mode 100644 addons/compat_ws/CfgVehicles.hpp diff --git a/addons/casings/CfgVehicles.hpp b/addons/casings/CfgVehicles.hpp index 9a1439d9e0c..73d06bc0ac6 100644 --- a/addons/casings/CfgVehicles.hpp +++ b/addons/casings/CfgVehicles.hpp @@ -1,39 +1,6 @@ class CfgVehicles { - class ThingEffect; - class FxCartridge_Small: ThingEffect { - GVAR(model) = "A3\Weapons_f\ammo\cartridge_small.p3d"; - }; - class FxCartridge: ThingEffect { - GVAR(model) = "A3\Weapons_f\ammo\cartridge.p3d"; - }; - class FxCartridge_65: FxCartridge { - GVAR(model) = "A3\weapons_f\ammo\cartridge_65.p3d"; - }; + class FxCartridge; class FxCartridge_65_caseless: FxCartridge { - GVAR(model) = ""; - }; - class FxCartridge_762: FxCartridge { - GVAR(model) = "A3\weapons_f\ammo\cartridge_762.p3d"; - }; - class FxCartridge_762x39: FxCartridge { - GVAR(model) = "A3\weapons_f_enoch\ammo\cartridge_762x39.p3d"; - }; - class FxCartridge_93x64_Ball: FxCartridge { - GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_93x64.p3d"; - }; - class FxCartridge_338_Ball: FxCartridge { - GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_338_LM.p3d"; - }; - class FxCartridge_338_NM_Ball: FxCartridge { - GVAR(model) ="A3\Weapons_F_Mark\Ammo\cartridge_338_NM.p3d"; - }; - class FxCartridge_127: FxCartridge { - GVAR(model) = "A3\weapons_f\ammo\cartridge_127.p3d"; - }; - class FxCartridge_127x54_APDS: FxCartridge { - GVAR(model) = "A3\Weapons_F_Mark\Ammo\cartridge_127x54.p3d"; - }; - class FxCartridge_slug: FxCartridge { - GVAR(model) = "A3\weapons_f\ammo\cartridge_slug.p3d"; + GVAR(model) = ""; // note: the vanilla 6.5 caseless don't actually use this, just being safe }; }; diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index 760eeba4528..5d3d052f4ad 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -27,15 +27,14 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { "" } else { private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge; - private _model = getText (_cartridgeConfig >> QGVAR(model)); - if (_model == "model") then { - _model = getText (_cartridgeConfig >> "model"); - - if ("a3\weapons_f\empty" in toLowerANSI _model) then { - _model = ""; - }; + // if explicty defined use ace's config + if (isText (_cartridgeConfig >> QGVAR(model))) exitWith { + getText (_cartridgeConfig >> QGVAR(model)) }; + // use casing's default model + private _model = getText (_cartridgeConfig >> "model"); + if ("a3\weapons_f\empty" in toLowerANSI _model) exitWith { "" }; // Add file extension if missing (fileExists needs file extension) if ((_model select [count _model - 4]) != ".p3d") then { diff --git a/addons/compat_cup_weapons/CfgVehicles.hpp b/addons/compat_cup_weapons/CfgVehicles.hpp deleted file mode 100644 index ab2655b3dcc..00000000000 --- a/addons/compat_cup_weapons/CfgVehicles.hpp +++ /dev/null @@ -1,10 +0,0 @@ -class CfgVehicles { - class FxCartridge; - class CUP_FxCartridge_545: FxCartridge { - EGVAR(casings,model) = "\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge545.p3d"; - }; - class CUP_FxCartridge_939: FxCartridge { - EGVAR(casings,model) ="\CUP\Weapons\CUP_Weapons_Ammunition\magazines\cartridge939.p3d"; - }; - // oicw? -}; diff --git a/addons/compat_cup_weapons/config.cpp b/addons/compat_cup_weapons/config.cpp index 4ce933d4edb..54dd0271ccc 100644 --- a/addons/compat_cup_weapons/config.cpp +++ b/addons/compat_cup_weapons/config.cpp @@ -17,5 +17,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" -#include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/compat_ws/CfgVehicles.hpp b/addons/compat_ws/CfgVehicles.hpp deleted file mode 100644 index 4b380a17ed2..00000000000 --- a/addons/compat_ws/CfgVehicles.hpp +++ /dev/null @@ -1,15 +0,0 @@ -class CfgVehicles { - class FxCartridge; - class FxCartridge_12Gauge_HE_lxWS: FxCartridge { - EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_he_lxws.p3d"; - }; - class FxCartridge_12Gauge_Slug_lxWS: FxCartridge { - EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_slug_lxws.p3d"; - }; - class FxCartridge_12Gauge_Smoke_lxWS: FxCartridge { - EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_smoke_lxws.p3d"; - }; - class FxCartridge_12Gauge_Pellet_lxWS: FxCartridge { - EGVAR(casings,model) = "lxWS\weapons_1_f_lxws\Ammo\cartridge_pellet_lxws.p3d"; - }; -}; diff --git a/addons/compat_ws/config.cpp b/addons/compat_ws/config.cpp index 745ce1370fe..32a3f6f73cb 100644 --- a/addons/compat_ws/config.cpp +++ b/addons/compat_ws/config.cpp @@ -16,4 +16,3 @@ class CfgPatches { }; #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" From d5ab50208753dda23bc0e7e0b35483c299e4ea61 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 6 Apr 2024 22:03:51 -0300 Subject: [PATCH 8/8] comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen --- addons/casings/functions/fnc_createCasing.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/casings/functions/fnc_createCasing.sqf b/addons/casings/functions/fnc_createCasing.sqf index 5d3d052f4ad..fe35ad5945c 100644 --- a/addons/casings/functions/fnc_createCasing.sqf +++ b/addons/casings/functions/fnc_createCasing.sqf @@ -28,7 +28,7 @@ private _modelPath = GVAR(cachedCasings) getOrDefaultCall [_ammo, { } else { private _cartridgeConfig = configFile >> "CfgVehicles" >> _cartridge; - // if explicty defined use ace's config + // if explicitly defined, use ACE's config if (isText (_cartridgeConfig >> QGVAR(model))) exitWith { getText (_cartridgeConfig >> QGVAR(model)) };