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

assign vehicle module fix for prefilled veh #2565

Merged
merged 1 commit into from
Sep 28, 2015
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
15 changes: 8 additions & 7 deletions addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
*
* Public: No
*/


#include "script_component.hpp"

private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList"];
private ["_setting", "_objects", "_list", "_splittedList", "_nilCheckPassedList", "_parsedList", "_xVehicle"];
params [["_logic", objNull, [objNull]]];

if (!isNull _logic) then {
Expand All @@ -42,21 +40,24 @@ if (!isNull _logic) then {
if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then {
{
if (!isnil "_x") then {
if (typeName _x == typeName objNull) then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
_x setvariable [QGVAR(medicClass), _setting, true];
_xVehicle = vehicle _x;
TRACE_3("setting medical vehicle", _x, _xVehicle, (typeOf _xVehicle));
_xVehicle setvariable [QGVAR(medicClass), _setting, true];
};
};
};
} foreach _objects;
};
{
if (!isnil "_x") then {
if (typeName _x == typeName objNull) then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
TRACE_2("setting medical vehicle", _x, (typeOf _x));
_x setvariable [QGVAR(medicClass), _setting, true];
};
};
};
} foreach _parsedList;
};
};