Skip to content

bugfix(update): Resolve mismatch caused by updating AssistedTargetingUpdate for one frame - #3212

Open
Stubbjax wants to merge 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-assisted-targeting-update-generals-mismatch
Open

bugfix(update): Resolve mismatch caused by updating AssistedTargetingUpdate for one frame#3212
Stubbjax wants to merge 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-assisted-targeting-update-generals-mismatch

Conversation

@Stubbjax

Copy link
Copy Markdown

This change is a follow-up to #2809 and fixes a mismatch in Generals that was caused by unifying the AssistedTargetingUpdate module's setup with Zero Hour, which allowed the module's update logic to run for one frame.

@Stubbjax Stubbjax self-assigned this Aug 26, 2026
@Stubbjax Stubbjax added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ThisProject The issue was introduced by this project, or this task is specific to this project labels Aug 26, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Prevent AssistedTargetingUpdate from running an initial frame

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Initializes assisted-targeting laser templates during module construction.
• Immediately sleeps the module forever, preventing a one-frame Generals synchronization mismatch.
• Removes redundant template resolution from update and load post-processing paths.
Diagram

graph TD
  A["Module config"] --> B["Constructor"] --> C["Resolve lasers"] --> D["Sleep forever"]
  C --> E["Assist attack"] --> F["Feedback lasers"]
Loading
High-Level Assessment

The constructor-based approach is appropriate because template references are immutable module setup data and the module is event-driven rather than frame-driven. Explicitly sleeping during construction prevents the unwanted first update without introducing conditional update logic or save-load-specific initialization.

Files changed (1) +5 / -12

Bug fix (1) +5 / -12
AssistedTargetingUpdate.cppInitialize targeting lasers before disabling scheduled updates +5/-12

Initialize targeting lasers before disabling scheduled updates

• Moves laser template lookup into module construction and immediately sets the module to sleep forever. Removes lookup work from the update and load post-processing paths, eliminating the single scheduled frame that caused Generals synchronization mismatches.

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Greptile Summary

The PR prevents AssistedTargetingUpdate from running for an initial simulation frame by resolving its feedback-laser templates during construction and immediately putting the module to sleep indefinitely.

  • Moves feedback-laser template resolution from update() and loadPostProcess() into the constructor.
  • Initializes the module wake frame to UPDATE_SLEEP_FOREVER.
  • Leaves update() as a permanently sleeping no-op.

Confidence Score: 5/5

The PR appears safe to merge, with no actionable correctness, security, or maintainability issues identified.

Constructor-time wake scheduling is supported by the object-registration lifecycle, and save loading reconstructs the module through the constructor so its derived template pointers are restored.

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp Initializes template references and permanent sleep state during module construction, eliminating the unintended first-frame update without introducing an actionable defect.

Reviews (1): Last reviewed commit: "bugfix: Resolve mismatch caused by updat..." | Re-trigger Greptile

@Mauller

Mauller commented Aug 26, 2026

Copy link
Copy Markdown

Maybe this should be gated so that when this code is merged the issue does not crop up again by someone else merging the same files.

@xezon xezon changed the title bugfix: Resolve mismatch caused by updating AssistedTargetingUpdate for one frame bugfix(update): Resolve mismatch caused by updating AssistedTargetingUpdate for one frame Aug 26, 2026

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code looks logical.

@xezon

xezon commented Aug 26, 2026

Copy link
Copy Markdown

Something is not right with the CI build. Again it is waiting on GeneralsMD and we cannot merge this.

@Caball009

Copy link
Copy Markdown

Maybe this should be gated so that when this code is merged the issue does not crop up again by someone else merging the same files.

Yes, I think that's a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ThisProject The issue was introduced by this project, or this task is specific to this project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generals mismatches due to PR 2809

4 participants