Skip to content

Commit

Permalink
Fix wrong return from getOrDefault in fn_createAIAirplane.sqf (#269)
Browse files Browse the repository at this point in the history
* Fix wrong return from getOrDefault

* More default return fixes
  • Loading branch information
SilenceIsFatto authored Aug 1, 2024
1 parent 4498a3f commit 837080e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions A3A/addons/core/functions/CREATE/fn_createAIAirplane.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ if (!_busy) then {
private _veh = objNull;
private _spawnParameter = [_markerX, "Plane"] call A3A_fnc_findSpawnPosition;
if(_spawnParameter isEqualType []) then {
private _vehPool = (_faction get "vehiclesPlanesCAS") + (_faction get "vehiclesPlanesAA") + (_faction getOrDefault ["vehiclesPlanesGunship", "vehiclesPlanesCAS"]) + (_faction getOrDefault ["uavsAttack", "vehiclesPlanesCAS"]);
private _vehPool = (_faction get "vehiclesPlanesCAS") + (_faction get "vehiclesPlanesAA") + (_faction getOrDefault ["vehiclesPlanesGunship", []]) + (_faction getOrDefault ["uavsAttack", []]);
if(count _vehPool > 0) then
{
_spawnsUsed pushBack _spawnParameter#2;
Expand All @@ -319,8 +319,8 @@ if (!_busy) then {
+ (_faction get "vehiclesPlanesCAS")
+ (_faction get "vehiclesPlanesAA")
+ (_faction get "vehiclesPlanesTransport");
+ (_faction getOrDefault ["vehiclesPlanesGunship", "vehiclesPlanesCAS"]);
+ (_faction getOrDefault ["uavsAttack", "vehiclesPlanesCAS"]);
+ (_faction getOrDefault ["vehiclesPlanesGunship", []]);
+ (_faction getOrDefault ["uavsAttack", []]);
_typeVehX = selectRandom _airVehTypes;
if (!isNil "_typeVehX") then {
_veh = createVehicle [_typeVehX, _pos, [],50, "NONE"];
Expand Down

0 comments on commit 837080e

Please sign in to comment.