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

Zeus - Fix remote control breaking Racks and resetting custom PTTs #1305

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion addons/api/fnc_getMultiPushToTalkAssignment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@

//Emulate behaviour of the handleMultiPttKeyPress algorithm

private _radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList);
private _radioLists = [];

if (acre_player isEqualTo player) then { // using zeus player voice
_radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList);
} else { // using zeus remote voice
_radioLists = [+ ACRE_ASSIGNED_PTT_RADIOS_REMOTE, [] call EFUNC(sys_data,getPlayerRadioList)] call EFUNC(sys_data,sortRadioList);
};

private _returnValue = (_radioLists select 1);

Expand Down
6 changes: 5 additions & 1 deletion addons/api/fnc_setMultiPushToTalkAssignment.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ private _index = _var findIf {

if (_index != -1) exitWith { false };

ACRE_ASSIGNED_PTT_RADIOS = _var;
if (acre_player isEqualTo player) then { // using zeus player voice
ACRE_ASSIGNED_PTT_RADIOS = _var;
} else { // using zeus remote voice
ACRE_ASSIGNED_PTT_RADIOS_REMOTE = _var;
};

true
1 change: 1 addition & 0 deletions addons/sys_core/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ DVAR(ACRE_LISTENER_DIVE) = 0;

DVAR(ACRE_PTT_RELEASE_DELAY) = 0.2;
DVAR(ACRE_ASSIGNED_PTT_RADIOS) = [];
DVAR(ACRE_ASSIGNED_PTT_RADIOS_REMOTE) = [];
GVAR(delayReleasePTT_Handle) = nil;

DVAR(ACRE_ACTIVE_PTTKEY) = -2;
Expand Down
16 changes: 11 additions & 5 deletions addons/sys_core/fnc_handleMultiPttKeyPress.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ if (ACRE_ACTIVE_PTTKEY == -2) then {
private _radioList = [] call EFUNC(sys_data,getPlayerRadioList);
if (ACRE_ACTIVE_PTTKEY <= (count _radioList) - 1) then {
if ((count ACRE_ASSIGNED_PTT_RADIOS) > 0) then {
private _sortList = [ACRE_ASSIGNED_PTT_RADIOS, _radioList] call EFUNC(sys_data,sortRadioList);
// This will handle cleanup automatically too
ACRE_ASSIGNED_PTT_RADIOS = _sortList select 0;
_radioList = _sortList select 1;

if (acre_player isEqualTo player) then { // using zeus player voice
private _sortList = [ACRE_ASSIGNED_PTT_RADIOS, _radioList] call EFUNC(sys_data,sortRadioList);
// This will handle cleanup automatically too
ACRE_ASSIGNED_PTT_RADIOS = _sortList select 0;
_radioList = _sortList select 1;
} else {
private _sortList = [ACRE_ASSIGNED_PTT_RADIOS_REMOTE, _radioList] call EFUNC(sys_data,sortRadioList);
// This will handle cleanup automatically too
ACRE_ASSIGNED_PTT_RADIOS_REMOTE = _sortList select 0;
_radioList = _sortList select 1;
};
};
_sendRadio = _radioList select ACRE_ACTIVE_PTTKEY;
[_sendRadio] call EFUNC(sys_radio,setActiveRadio);
Expand Down
2 changes: 1 addition & 1 deletion addons/sys_rack/fnc_enterVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

params ["_vehicle", "_unit"];

if (_unit != _vehicle) then {
if (_unit != _vehicle && {isNull remoteControlled _unit}) then {
private _initialized = _vehicle getVariable [QGVAR(initialized), false];

if (!_initialized) then {
Expand Down