Fixed client setting Draw3D installation/removal handling

This commit is contained in:
jonpas 2015-05-15 18:13:10 +02:00
parent 1ccc7e1e0a
commit 02b9df1bc3

View File

@ -33,12 +33,13 @@ if (!GVAR(showPlayerNamesForce)) then {
["SettingChanged", {
PARAMS_2(_name,_value)
if (_name == QGVAR(showPlayerNames)) then {
if ((GVAR(showPlayerNames) > 0) && (_value == 0)) then {
removeMissionEventHandler ["Draw3D", GVAR(drawHandler)];
GVAR(drawHandler) = nil;
};
if ((GVAR(showPlayerNames) == 0) && (_value > 0)) then {
if (isNil(QGVAR(drawHandler)) && {_value > 0}) then {
GVAR(drawHandler) = addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}];
} else {
if (_value == 0) then {
removeMissionEventHandler ["Draw3D", GVAR(drawHandler)];
GVAR(drawHandler) = nil;
};
};
};
}] call EFUNC(common,addEventHandler);