fix: attribute Zeus remote-controlled shots to the controlled unit#110
fix: attribute Zeus remote-controlled shots to the controlled unit#110
Conversation
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.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where actions performed by AI units under Zeus remote control were misattributed to the Zeus curator. By enhancing the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a bug where shots from a Zeus remote-controlled unit were attributed to the Zeus curator instead of the gunner. The solution uses the correct BIS functions to identify the remote-controlled unit and re-attribute the shot. The changes are applied to both fnc_eh_firedMan.sqf and fnc_eh_fired_client.sqf. My feedback includes a minor suggestion to improve code consistency between the two modified files.
Use local variable + if/then/else in eh_firedMan to match eh_fired_client.
Summary
FiredManEH fires on the controller's body, not the controlled unit — so_firerwas the Zeus uniteh_firedMan) used a distance-based heuristic (> 50m) that silently failed when Zeus was near the static gun; the proper fix was identified in commented-out code but never implementedeh_fired_client) checkedBIS_fnc_moduleRemoteControl_owneron_firer, but that variable lives on the controlled unit, not the controller's body — so the lookup always missedbis_fnc_moduleRemoteControl_unit(missionNamespace, local to the controller's machine where FiredMan fires) to detect remote control, verified viaBIS_fnc_moduleRemoteControl_owneron the controlled unit, then swap_firerand recalculate_vehicleTest plan