Skip to content

Commit

Permalink
Add error catching for vehicle spawns in admiral
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyruz143 committed Oct 26, 2024
1 parent a85e149 commit 2e83e2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/admiral/common_functions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ adm_common_fnc_placeVehicle = {
};
private _vehiclePosition = [_area, _position, _className] call adm_common_fnc_getRandomEmptyPositionInArea;
private _vehicle = createVehicle [_className, _vehiclePosition, [], 0, "NONE"];
if (isNull _vehicle) exitWith {
private _errorMessage = format ["Failed to create unit %1 at position %2, with classname %3 and classNameArguments %4!",_vehicle,_position,_className,_classNameArguments];
ERROR_MSG_1("admiral.common.create: %1",_errorMessage);

_vehicle;
};
_vehicle setVariable ["adm_classNameArguments", _classNameArguments, false];
_vehicle allowCrewInImmobile [adm_allowCrewInImmobile, false];
_vehicle setUnloadInCombat [adm_cargoUnloadInCombat, false];
Expand Down

0 comments on commit 2e83e2c

Please sign in to comment.