Skip to content

bugfix(update): Resolve mismatch in Generals caused by updating AssistedTargetingUpdate for the initial frame - #3212

Merged
xezon merged 3 commits into
TheSuperHackers:mainfrom
Stubbjax:fix-assisted-targeting-update-generals-mismatch
Aug 29, 2026
Merged

bugfix(update): Resolve mismatch in Generals caused by updating AssistedTargetingUpdate for the initial frame#3212
xezon merged 3 commits 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 moves assisted-targeting laser-template resolution into module construction and adjusts initial wake scheduling to preserve the intended per-variant compatibility behavior.

  • Resolves both laser templates during construction rather than during the first update or load post-processing.
  • Prevents the initial update in Generals and non-retail-compatible builds while retaining Zero Hour retail-compatible scheduling.
  • Applies equivalent changes to the Generals and GeneralsMD implementations.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp Moves template lookup into construction and puts the module to sleep immediately for the Generals build.
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp Moves template lookup into construction and conditionally preserves the one-update Zero Hour retail-compatible behavior.

Reviews (4): Last reviewed commit: "chore: Allow non-compatible CRC games to..." | 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.

@Stubbjax
Stubbjax force-pushed the fix-assisted-targeting-update-generals-mismatch branch from 0f9d7c5 to d2e539d Compare August 27, 2026 14:11

@Mauller Mauller 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.

Looks good to me

@xezon xezon changed the title bugfix(update): Resolve mismatch caused by updating AssistedTargetingUpdate for one frame bugfix(update): Resolve mismatch in Generals caused by updating AssistedTargetingUpdate for one frame Aug 29, 2026
@xezon xezon changed the title bugfix(update): Resolve mismatch in Generals caused by updating AssistedTargetingUpdate for one frame bugfix(update): Resolve mismatch in Generals caused by updating AssistedTargetingUpdate for the initial frame Aug 29, 2026
@xezon
xezon merged commit 171701e into TheSuperHackers:main Aug 29, 2026
23 checks passed
@Stubbjax
Stubbjax deleted the fix-assisted-targeting-update-generals-mismatch branch August 29, 2026 13:23
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