diff --git a/addons/medical_treatment/functions/fnc_createLitterServer.sqf b/addons/medical_treatment/functions/fnc_createLitterServer.sqf index afeba0eb36b..b19ddc9baa5 100644 --- a/addons/medical_treatment/functions/fnc_createLitterServer.sqf +++ b/addons/medical_treatment/functions/fnc_createLitterServer.sqf @@ -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;