Skip to content

fix(update): Fix laser-to-target setup mistake in AssistedTargetingUpdate#2817

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-assisted-targeting-update-module-template-parsing-mistake
Jun 21, 2026
Merged

fix(update): Fix laser-to-target setup mistake in AssistedTargetingUpdate#2817
xezon merged 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-assisted-targeting-update-module-template-parsing-mistake

Conversation

@Stubbjax

Copy link
Copy Markdown

This change fixes a copy-and-paste mistake in Zero Hour's AssistedTargetingUpdate module when reading template data, which causes the module's LaserToTarget field to use the value assigned to the LaserFromAssisted field.

This has no effect on retail games as all LaserFromAssisted and LaserToTarget fields share the same value regardless, as shown below.

Behavior = AssistedTargetingUpdate ModuleTag_XX
  LaserFromAssisted = PatriotBinaryDataStream ; Stream to draw from the requestor to me
  LaserToTarget = PatriotBinaryDataStream ; Stream to draw from me to the target
End

@Stubbjax Stubbjax self-assigned this Jun 21, 2026
@Stubbjax Stubbjax added Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour Fix Is fixing something, but is not user facing labels Jun 21, 2026
@greptile-apps

greptile-apps Bot commented Jun 21, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes a copy-paste bug in AssistedTargetingUpdate where m_laserToTarget was incorrectly initialized using d->m_laserFromAssistedName instead of d->m_laserToTargetName. The fix is applied consistently in both the update() and loadPostProcess() methods.

  • The bug caused both laser template pointers to resolve to the same template (LaserFromAssisted), meaning LaserToTarget was silently ignored; with different template names these two lasers would have rendered identically.
  • The fix is minimal and surgical — two single-field substitutions with no surrounding logic changes.

Confidence Score: 5/5

Safe to merge — the change is a targeted two-line fix with no side effects.

Both update() and loadPostProcess() now consistently resolve m_laserToTarget from its own named template field. The fix is correct, symmetrical, and touches no surrounding logic. The PR description also correctly notes this has no effect on retail data where both names share the same value, so there is no risk of regression in the shipped content.

No files require special attention.

Important Files Changed

Filename Overview
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AssistedTargetingUpdate.cpp Corrects copy-paste error: m_laserToTarget now reads from d->m_laserToTargetName instead of d->m_laserFromAssistedName in both update() and loadPostProcess().

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[AssistedTargetingUpdate::update / loadPostProcess] --> B[Read m_laserFromAssistedName]
    B --> C[TheThingFactory::findTemplate]
    C --> D[m_laserFromAssisted]
    A --> E[Read m_laserToTargetName]
    E --> F[TheThingFactory::findTemplate]
    F --> G[m_laserToTarget]

    D --> H[makeFeedbackLaser: requestor -> me]
    G --> I[makeFeedbackLaser: me -> target]

    style E fill:#90EE90
    style G fill:#90EE90
    style I fill:#90EE90
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[AssistedTargetingUpdate::update / loadPostProcess] --> B[Read m_laserFromAssistedName]
    B --> C[TheThingFactory::findTemplate]
    C --> D[m_laserFromAssisted]
    A --> E[Read m_laserToTargetName]
    E --> F[TheThingFactory::findTemplate]
    F --> G[m_laserToTarget]

    D --> H[makeFeedbackLaser: requestor -> me]
    G --> I[makeFeedbackLaser: me -> target]

    style E fill:#90EE90
    style G fill:#90EE90
    style I fill:#90EE90
Loading

Reviews (1): Last reviewed commit: "fix: Fix copy-and-paste mistake in Assis..." | Re-trigger Greptile

@xezon xezon changed the title fix: Fix copy-and-paste mistake in AssistedTargetingUpdate fix(update): Fix laser-to-target setup mistake in AssistedTargetingUpdate Jun 21, 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.

Looking good

@xezon xezon merged commit a3cafc3 into TheSuperHackers:main Jun 21, 2026
12 checks passed
@Stubbjax Stubbjax deleted the fix-assisted-targeting-update-module-template-parsing-mistake branch June 22, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix Is fixing something, but is not user facing Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants