From 723ab0f7356e4e3e8b1587af378b79de35189602 Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Sun, 15 Mar 2026 12:17:19 +0100 Subject: [PATCH 1/2] fix: attribute Zeus remote-controlled shots to the controlled unit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a Zeus curator remote-controls an AI manning a static weapon, FiredMan fires on the controller's body — not the controlled unit. This caused all rounds to be recorded as originating from the Zeus unit instead of the .50cal gunner. Replace the old distance-based heuristic in eh_firedMan with a proper check using bis_fnc_moduleRemoteControl_unit (missionNamespace, local to the controller's machine) and BIS_fnc_moduleRemoteControl_owner (broadcast on the controlled unit). Both fired handlers now swap _firer and recalculate _vehicle from the controlled unit's state. --- addons/recorder/fnc_eh_firedMan.sqf | 20 +++++++------------- addons/recorder/fnc_eh_fired_client.sqf | 12 ++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/addons/recorder/fnc_eh_firedMan.sqf b/addons/recorder/fnc_eh_firedMan.sqf index 0fd8dde..cb12b18 100644 --- a/addons/recorder/fnc_eh_firedMan.sqf +++ b/addons/recorder/fnc_eh_firedMan.sqf @@ -41,21 +41,15 @@ if (!SHOULDSAVEEVENTS) exitWith {}; params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; -private _initialProjPos = getPosASL _projectile; -if (getPos _firer distance _initialProjPos > 50 || vehicle _firer isKindOf "Air") then { - // if projectile in unscheduled environment is > 50m from FiredMan then likely remote controlled - // we should find the actual firing entity - private _nearest = [_initialProjPos, allUnits select { - !isPlayer _x - }, 75] call CBA_fnc_getNearest; - if (count _nearest > 0) then { - _firer = _nearest#0; - }; +// Zeus remote control fix: FiredMan fires on the controller's body, not the +// controlled unit. Swap to the actual controlled unit for correct attribution. +private _controlledUnit = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]; +if (!isNull _controlledUnit && {_controlledUnit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull] isEqualTo _firer}) then { + _firer = _controlledUnit; + _vehicle = vehicle _controlledUnit; + if (_vehicle isEqualTo _controlledUnit) then { _vehicle = objNull; }; }; -// missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", _firer]; -// _unit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull]; - // not sent in ACE Throwing events if (isNil "_vehicle") then { _vehicle = objNull diff --git a/addons/recorder/fnc_eh_fired_client.sqf b/addons/recorder/fnc_eh_fired_client.sqf index 89d32f5..ccb717b 100644 --- a/addons/recorder/fnc_eh_fired_client.sqf +++ b/addons/recorder/fnc_eh_fired_client.sqf @@ -15,6 +15,18 @@ if (isNil "_projectile") exitWith { false; }; +// Zeus remote control fix: FiredMan fires on the controller's body, not the +// controlled unit. bis_fnc_moduleRemoteControl_unit (local to the controller's +// machine) gives us the actual unit doing the firing. +private _controlledUnit = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]; +if (!isNull _controlledUnit && {_controlledUnit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull] isEqualTo _firer}) then { + TRACE_2("Swapping firer from Zeus body to remote-controlled unit",name _firer,name _controlledUnit); + _firer = _controlledUnit; + // Fix _vehicle — Zeus body isn't in the static weapon, but the controlled unit is + private _controlledVehicle = vehicle _controlledUnit; + _vehicle = if (_controlledVehicle isEqualTo _controlledUnit) then {objNull} else {_controlledVehicle}; +}; + // get ocap id of firer private _firerOcapId = _firer getVariable [QGVARMAIN(id), -1]; if (_firerOcapId isEqualTo -1) exitWith { From ffd0465fe0790ec7c59a7566d17fe4819b8730ce Mon Sep 17 00:00:00 2001 From: Florian Kinder Date: Sun, 15 Mar 2026 12:21:39 +0100 Subject: [PATCH 2/2] style: consistent vehicle resolution pattern across fired handlers Use local variable + if/then/else in eh_firedMan to match eh_fired_client. --- addons/recorder/fnc_eh_firedMan.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/recorder/fnc_eh_firedMan.sqf b/addons/recorder/fnc_eh_firedMan.sqf index cb12b18..19727a6 100644 --- a/addons/recorder/fnc_eh_firedMan.sqf +++ b/addons/recorder/fnc_eh_firedMan.sqf @@ -46,8 +46,8 @@ params ["_firer", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_project private _controlledUnit = missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", objNull]; if (!isNull _controlledUnit && {_controlledUnit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull] isEqualTo _firer}) then { _firer = _controlledUnit; - _vehicle = vehicle _controlledUnit; - if (_vehicle isEqualTo _controlledUnit) then { _vehicle = objNull; }; + private _controlledVehicle = vehicle _controlledUnit; + _vehicle = if (_controlledVehicle isEqualTo _controlledUnit) then {objNull} else {_controlledVehicle}; }; // not sent in ACE Throwing events