Skip to content

fix: detect entity deletion by Zeus and scripts via null tracking#109

Merged
fank merged 1 commit intomainfrom
fix/zeus-entity-deletion-tracking
Mar 11, 2026
Merged

fix: detect entity deletion by Zeus and scripts via null tracking#109
fank merged 1 commit intomainfrom
fix/zeus-entity-deletion-tracking

Conversation

@fank
Copy link
Member

@fank fank commented Mar 11, 2026

Summary

  • Units: Add trackedUnits HashMap (mirroring trackedVehicles) to detect deleted units via isNull check each frame, sending :SOLDIER:DELETE: when detected. Removes entries on disconnect/respawn to avoid duplicate DELETEs.
  • Vehicles: The existing isNull detection sent a final dead state but no :VEHICLE:DELETE:, so gap-fill had no termination boundary. Now sends DELETE after the dead state.
  • Catches all deletion sources: Zeus, deleteVehicle, garbage collection.

Root cause

The dedup optimization (commits 88eabe7/424bed3) combined with extension gap-fill (eea4801) caused Zeus-deleted entities to persist in recordings forever. Without an explicit DELETE command, gap-fill extends the last alive state to the end of the recording.

Test plan

  • Start recording, place units and vehicles via Zeus, delete them — verify they disappear from playback at the correct frame
  • Verify player disconnect still works correctly (entity disappears)
  • Verify respawn still works correctly (corpse disappears)
  • Verify normal unit death is unaffected (body stays as dead)

The dedup optimization (commits 83/84) combined with extension gap-fill
caused Zeus-deleted entities to persist in recordings. Without an
explicit DELETE command, gap-fill extends the last alive state to the
end of the recording.

Units: add trackedUnits HashMap mirroring trackedVehicles. Each frame,
check for null object handles and send :SOLDIER:DELETE: when detected.
Remove from HashMap on disconnect/respawn to avoid duplicate DELETEs.

Vehicles: the existing isNull detection sent a final dead state but no
:VEHICLE:DELETE:, so gap-fill had no boundary. Now sends DELETE after
the dead state.

Catches all deletion sources: Zeus, deleteVehicle, garbage collection.
@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 introduces robust entity deletion tracking for both units and vehicles within the recorder system. It resolves a critical issue where deleted entities, particularly those removed by Zeus or scripts, would incorrectly persist in recordings, leading to inaccurate playback. By implementing explicit deletion detection and corresponding :DELETE: events, the system now ensures that all entity removals are properly captured and reported, providing accurate and complete recording data.

Highlights

  • Units Deletion Tracking: Implemented a trackedUnits HashMap to monitor units and detect their deletion (e.g., by Zeus or scripts) using isNull checks, ensuring a :SOLDIER:DELETE: event is sent. Units are also removed from tracking upon disconnect or respawn.
  • Vehicle Deletion Reporting: Enhanced vehicle tracking to explicitly send a :VEHICLE:DELETE: event after a vehicle is detected as dead, providing a clear termination boundary for gap-fill logic.
  • Comprehensive Deletion Coverage: The changes now correctly handle entity deletions from all sources, including Zeus, deleteVehicle commands, and garbage collection, preventing entities from persisting indefinitely in recordings.
  • Root Cause Addressed: Fixed an issue where Zeus-deleted entities would incorrectly persist in recordings due to previous dedup optimizations and gap-fill logic, which lacked explicit deletion commands.
Changelog
  • addons/recorder/fnc_addEventMission.sqf
    • Removed respawned units from the trackedUnits HashMap to prevent duplicate deletion events.
  • addons/recorder/fnc_captureLoop.sqf
    • Initialized a new trackedUnits HashMap for monitoring units.
    • Added newly initialized units to the trackedUnits HashMap.
    • Implemented logic to iterate through trackedUnits, detect isNull units, send :SOLDIER:DELETE: events, and remove them from the map.
    • Added a :VEHICLE:DELETE: event to be sent for vehicles detected as null, after their final dead state is reported.
  • addons/recorder/fnc_eh_disconnected.sqf
    • Removed disconnected units from the trackedUnits HashMap.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive tracking for individual units (soldiers) in addition to existing vehicle tracking. It initializes a new trackedUnits hash map, adds units to this map upon initialization, and ensures their removal with corresponding :SOLDIER:DELETE: events when units die, disconnect, or disappear from the game world. Additionally, :VEHICLE:DELETE: events are now explicitly sent when tracked vehicles disappear, enhancing the accuracy of recorded entity lifecycles.

@fank fank merged commit 13774b7 into main Mar 11, 2026
1 of 2 checks passed
@fank fank deleted the fix/zeus-entity-deletion-tracking branch March 11, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant