Skip to content

Commit

Permalink
Merge pull request #3287 from jaj22/block-SAM-WW2-factions
Browse files Browse the repository at this point in the history
Prevent SAM supports being used by WW2 factions
  • Loading branch information
Bob-Murphy authored Jun 15, 2024
2 parents 5778cd0 + 27f60d5 commit 11bd70f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//////////////////////////

["attributeLowAir", true] call _fnc_saveToTemplate; // Use fewer air units in general
["attributeNoSAM", true] call _fnc_saveToTemplate; // Don't use SAM supports

["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate;
["surrenderCrate", "SPE_Mine_AmmoBox_US"] call _fnc_saveToTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//////////////////////////

["attributeLowAir", true] call _fnc_saveToTemplate; // Use fewer air units in general
["attributeNoSAM", true] call _fnc_saveToTemplate; // Don't use SAM supports

["ammobox", "B_supplyCrate_F"] call _fnc_saveToTemplate;
["surrenderCrate", "SPE_Weaponcrate_MP40_GER"] call _fnc_saveToTemplate;
Expand Down
2 changes: 2 additions & 0 deletions A3A/addons/core/functions/Supports/fn_initSupports.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ private _fnc_buildSupportHM =
{
params ["_faction"];
private _lowAir = _faction getOrDefault ["attributeLowAir", false];
private _noSAM = _faction getOrDefault ["attributeNoSAM", false];
private _suppHM = createHashMap;
{
_x params ["_suppType", "_baseType", "_weight", "_lowAirWeight", "_effRadius", "_strikepower", "_flags", "_reqType"];
if (_faction get _reqType isEqualTo []) then { continue };
if ("u" in _flags and !allowUnfairSupports) then { continue };
if ("f" in _flags and !allowFuturisticSupports) then { continue };
if (_suppType == "SAM" and _noSAM) then { continue };

private _weight = [_weight, _lowAirWeight] select _lowAir;
_suppHM set [_suppType, [_baseType, _weight, _effRadius, _strikepower]];
Expand Down

0 comments on commit 11bd70f

Please sign in to comment.