Skip to content

Commit a8198cf

Browse files
author
Oliver Krüppel
committed
disable role check if whitelist is disabled
1 parent cee707c commit a8198cf

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
#include "macros.hpp"
22

33
params [
4-
["_unit", objNull, [objNull, ""]],
4+
["_unit", objNull, [objNull]],
55
["_role", "", [""]]
66
];
77

8-
if (_unit isEqualType objNull) then {
9-
if (isNull _unit) exitWith {};
8+
if (isNull _unit) exitWith {};
9+
private _slot = str _role;
10+
11+
private _roles = GVAR(slotRoles) getOrDefault [_slot, []];
1012

11-
_unit = str _unit;
12-
};
13-
14-
private _roles = GVAR(slotRoles) getOrDefault [_unit, []];
15-
16-
_role in _roles
13+
_role in _roles;

addons/whitelist/functions/fn_initPlayer.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ GVAR(uavList) = [];
66

77
player addEventHandler ["SeatSwitchedMan", {
88
params ["_unit1", "_unit2", "_vehicle"];
9+
if (!GVAR(enableWhitelist)) exitWith {};
910
if (([_unit2] call CBA_fnc_vehicleRole) isEqualTo "cargo") exitWith {};
1011
[_unit2, _vehicle] remoteExecCall [QFUNC(handleRoleCheck), 2];
1112
}];
1213

1314
player addEventHandler ["GetInMan", {
1415
params ["_unit", "_role", "_vehicle", "_turret"];
16+
if (!GVAR(enableWhitelist)) exitWith {};
1517
if (_role isEqualTo "cargo") exitWith {};
1618
[_unit, _vehicle] remoteExecCall [QFUNC(handleRoleCheck), 2];
1719
}];

0 commit comments

Comments
 (0)