Skip to content

Commit

Permalink
Merge pull request #1668 from johnb432/disposable-add-errors
Browse files Browse the repository at this point in the history
Disposable - Throw errors for invalid config entries for disposable launchers
  • Loading branch information
PabstMirror committed Jul 28, 2024
2 parents cb74759 + 728336d commit 7fb18f4
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion addons/disposable/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,27 @@ private _cfgMagazines = configFile >> "CfgMagazines";
{
private _launcher = configName _x;
private _magazine = configName (_cfgMagazines >> (getArray (_cfgWeapons >> _launcher >> "magazines") select 0));
getArray _x params ["_loadedLauncher", "_usedLauncher"];

if (_magazine == "") then {
ERROR_1("Launcher %1 has an undefined magazine.",_launcher);

continue;
};

(getArray _x) params [["_loadedLauncher", "", [""]], ["_usedLauncher", "", [""]]];

if (_loadedLauncher == "") then {
ERROR_1("Launcher %1 has an undefined loaded launcher.",_launcher);

continue;
};

if (_usedLauncher == "") then {
ERROR_1("Launcher %1 has an undefined used launcher.",_launcher);

continue;
};

private _fitsInBackpacks = TYPE_BACKPACK in getArray (configFile >> "CfgWeapons" >> _loadedLauncher >> "WeaponSlotsInfo" >> "allowedSlots");

GVAR(LoadedLaunchers) setVariable [_launcher, _loadedLauncher];
Expand Down

0 comments on commit 7fb18f4

Please sign in to comment.