mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Run on ACE_player instead of all units
This commit is contained in:
parent
ec17efe6f9
commit
ab9c1c15eb
@ -32,7 +32,28 @@ GVAR(isUsingMagnification) = false;
|
||||
["turret", LINKFUNC(refreshGoggleType), true] call CBA_fnc_addPlayerEventHandler;
|
||||
["ACE_controlledUAV", LINKFUNC(refreshGoggleType)] call CBA_fnc_addEventHandler;
|
||||
|
||||
["CAManBase", "SlotItemChanged", LINKFUNC(onSlotItemChanged)] call CBA_fnc_addClassEventHandler;
|
||||
["unit", {
|
||||
params ["_newPlayer", "_oldPlayer"];
|
||||
|
||||
private _ehID = _oldPlayer getVariable QGVAR(ehID);
|
||||
|
||||
if (!isNil "_ehID") then {
|
||||
_oldPlayer removeEventHandler ["SlotItemChanged", _ehID];
|
||||
|
||||
_oldPlayer setVariable [QGVAR(ehID), nil];
|
||||
};
|
||||
|
||||
_ehID = _newPlayer getVariable QGVAR(ehID);
|
||||
|
||||
if (isNil "_ehID") then {
|
||||
// Call manually to update existing value
|
||||
[] call FUNC(refreshGoggleType);
|
||||
|
||||
_ehID = _newPlayer addEventHandler ["SlotItemChanged", LINKFUNC(onSlotItemChanged)];
|
||||
|
||||
_newPlayer setVariable [QGVAR(ehID), _ehID];
|
||||
};
|
||||
}, true] call CBA_fnc_addPlayerEventHandler;
|
||||
|
||||
// handle only brightness if effects are disabled
|
||||
GVAR(ppEffectNVGBrightness) = ppEffectCreate ["ColorCorrections", 1236];
|
||||
|
@ -19,9 +19,10 @@
|
||||
*/
|
||||
|
||||
params ["_unit", "_item", "_slot", "_assign"];
|
||||
TRACE_4("onSlotItemChange",_unit,_item,_slot,_assign);
|
||||
TRACE_4("onSlotItemChanged",_unit,_item,_slot,_assign);
|
||||
|
||||
if (_slot != TYPE_HMD) exitWith {};
|
||||
|
||||
if (_unit != ACE_player || _slot != TYPE_HMD) exitWith {};
|
||||
if (!_assign) exitWith {
|
||||
GVAR(playerHMD) = "";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user