From 5b272cebb5026a247f5a2c7ea5aa74ecc89a903b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 18 Feb 2017 17:00:47 -0600 Subject: [PATCH] Fix for bugged PlayerViewChanged event (#595) --- addons/events/fnc_addPlayerEventHandler.sqf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/events/fnc_addPlayerEventHandler.sqf b/addons/events/fnc_addPlayerEventHandler.sqf index 52838dce5..3d365a9c9 100644 --- a/addons/events/fnc_addPlayerEventHandler.sqf +++ b/addons/events/fnc_addPlayerEventHandler.sqf @@ -137,6 +137,15 @@ if (_id != -1) then { }; }; + // Fix for problems with PlayerViewChanged eh not always firing on vehicle switch on dedicated + // Look into removing this block if event is fixed + _data = vehicle _player; + if !(_data isEqualTo GVAR(oldVehicle)) then { + TRACE_1("Using fallback polling event for vehicle change",_data); + GVAR(oldVehicle) = _data; + [QGVAR(vehicleEvent), [_player, _data]] call CBA_fnc_localEvent; + }; + _data = _player call CBA_fnc_turretPath; if !(_data isEqualTo GVAR(oldTurret)) then { GVAR(oldTurret) = _data;