Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical Treatment - Allow creating litter from classes #10649

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading