Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat RHS - Fix explosives compat #9571

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ class CfgPatches {

#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgVehicles.hpp"
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CfgMagazines {

class ATMine_Range_Mag;
class rhs_mine_M19_mag: ATMine_Range_Mag {
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_mine_M19);
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_mine_M19);
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
Expand All @@ -34,7 +34,7 @@ class CfgMagazines {
};

class rhsusf_mine_m14_mag: ATMine_Range_Mag {
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_mine_m14);
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_mine_m14);
class ACE_Triggers {
SupportedTriggers[] = {"PressurePlate"};
class PressurePlate {
Expand All @@ -44,7 +44,7 @@ class CfgMagazines {
};

class rhsusf_mine_m49a1_3m_mag: ATMine_Range_Mag {
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_mine_m49a1_3m);
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_mine_m49a1_3m);
class ACE_Triggers {
SupportedTriggers[] = {"Tripwire"};
class Tripwire {
Expand All @@ -54,10 +54,10 @@ class CfgMagazines {
};

class rhsusf_mine_m49a1_6m_mag: rhsusf_mine_m49a1_3m_mag {
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_mine_m49a1_6m);
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_mine_m49a1_6m);
};

class rhsusf_mine_m49a1_10m_mag: rhsusf_mine_m49a1_3m_mag {
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_mine_m49a1_10m);
EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_mine_m49a1_10m);
};
};
24 changes: 24 additions & 0 deletions addons/explosives/dev/test_magazines.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "..\script_component.hpp"
// call compileScript ["z\ace\addons\explosives\dev\test_magazines.sqf"];

INFO("--- Checking Explosive Mags ---");

private _explosivesMags = compatibleMagazines "Put";
private _setupHash = createHashMap;
{
private _mag = _x;
private _cfg = configFile >> "CfgMagazines" >> _mag;
private _scope = getNumber (_cfg >> "scope");

private _setupObject = getText (_cfg >> QGVAR(SetupObject));
if (_setupObject == "") then {
WARNING_2("[%1](scope %2) has no setupObject",_mag,_scope);
continue
};
if (!isClass (configFile >> "CfgVehicles" >> _setupObject)) then {
ERROR_2("[%1](scope %2) has invalid setup object",_mag,_scope);
};
if ((((_setupHash getOrDefault [_setupObject, [], true]) pushBack _mag) > 0)) then {
INFO_2("[%1] setupObject has multiple mags %2",_setupObject,_setupHash get _setupObject);
};
} forEach _explosivesMags;