Skip to content

Commit

Permalink
Zeus - Fix remote control breaking Racks and resetting custom PTTs (#…
Browse files Browse the repository at this point in the history
…1305)

Co-authored-by: jonpas <[email protected]>
  • Loading branch information
mrschick and jonpas authored Sep 23, 2024
1 parent 6d10dd4 commit e5c1bba
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
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) = []; // Remote controlled unit
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
2 changes: 2 additions & 0 deletions docs/wiki/user/vehicle-racks.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ In order to use and mount and unmount (when possible) a vehicle rack, ACE3 Inter

Configuring the vehicle rack (opening the radio GUI) is disabled for *turned out* positions.

**Note:** Vehicle Racks cannot be accessed by AI that is being remote controlled by a Zeus Gamemaster.

## Vehicle intercom

In addition, vehicle racks are integrated into the intercom system. A rack with access to *crew* or *passenger* intercom allows players without access to the rack to hear incoming transmissions. These players however, will not be able to configure the radio nor transmit through it in the current implementation.
Expand Down

0 comments on commit e5c1bba

Please sign in to comment.