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

Events - Player events will report driver seat as turret [-1] #1313

Merged
merged 3 commits into from
Mar 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions addons/events/fnc_addPlayerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private _id = switch (_type) do {
};
case "turretweapon": {
if (_applyRetroactively) then {
[GVAR(oldUnit), GVAR(oldUnit) currentWeaponTurret (GVAR(oldUnit) call CBA_fnc_turretPath), ""] call _function;
[GVAR(oldUnit), GVAR(oldTurretWeapon), ""] call _function;
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
};
[QGVAR(turretWeaponEvent), _function] call CBA_fnc_addEventHandler // return id
};
Expand Down Expand Up @@ -95,7 +95,7 @@ private _id = switch (_type) do {
};
case "turret": {
if (_applyRetroactively) then {
[GVAR(oldUnit), GVAR(oldUnit) call CBA_fnc_turretPath, []] call _function;
[GVAR(oldUnit), GVAR(oldTurret), []] call _function;
PabstMirror marked this conversation as resolved.
Show resolved Hide resolved
};
[QGVAR(turretEvent), _function] call CBA_fnc_addEventHandler // return id
};
Expand Down
3 changes: 2 additions & 1 deletion addons/events/fnc_playerEvent.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ if (!isNull getConnectedUAV _unit) then {

private _turret = [];
if (_unit != _vehicle) then {
_turret = allTurrets [_vehicle, true] select {_vehicle turretUnit _x == _unit} param [0, []];
// Unlike CBA_fnc_turretPath, this will return [-1] when player is driver
_turret = ([[-1]] + allTurrets [_vehicle, true]) select {_vehicle turretUnit _x == _unit} param [0, []];
};

private _state = [
Expand Down