Skip to content

Commit

Permalink
Medical Treatment - Allow creating litter from classes (#10649)
Browse files Browse the repository at this point in the history
  • Loading branch information
DartRuffian authored Jan 13, 2025
1 parent 064e1eb commit 6e6ad93
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions addons/medical_treatment/functions/fnc_createLitterServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,22 @@ if (isNil QGVAR(litterObjects)) then {
GVAR(litterCleanup) = false;
};

private _model = getText (configFile >> "CfgVehicles" >> _litterClass >> "model");
if (_model == "") exitWith {};
private _config = configFile >> "CfgVehicles" >> _litterClass;
private _modelOrClass = if (getNumber (_config >> QGVAR(useClass)) == 1) then {
_litterClass
} else {
getText (_config >> "model");
};


if (_modelOrClass == "") exitWith {};

// createSimpleObject expects a path without the leading slash
if (_model select [0, 1] == "\") then {
_model = _model select [1];
if (_modelOrClass select [0, 1] == "\") then {
_modelOrClass = _modelOrClass select [1];
};

private _object = createSimpleObject [_model, [0, 0, 0]];
private _object = createSimpleObject [_modelOrClass, [0, 0, 0]];
_object setPosASL _position;
_object setDir _direction;

Expand Down

0 comments on commit 6e6ad93

Please sign in to comment.