Skip to content

chore: Remove debug code for KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING - #2478

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
mirelle7:feature/remove-aircraft-carrier-hack
Mar 21, 2026
Merged

chore: Remove debug code for KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING#2478
xezon merged 1 commit into
TheSuperHackers:mainfrom
mirelle7:feature/remove-aircraft-carrier-hack

Conversation

@mirelle7

Copy link
Copy Markdown

feat: Remove aircraft carrier debugging hack

Removes legacy Aircraft Carrier debugging code that was originally introduced for temporary deck-logic troubleshooting. This hack was already inactive in the game as it was commented out in the source.

  • Removed KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING macro.
  • Standardized MAX_GROUPS to 10 in W3DDisplayStringManager.
  • Removed debug numeral formatting and aircraft carrier deck indexing logic.
  • Cleaned up associated conditional includes and code blocks.
  • Applied changes to both Generals and GeneralsMD for consistency.

Reasoning: Cleaning up old development debt and removing logic that is no longer active or helpful. This reduces noise in the source files and simplifies the W3D initialization and rendering paths.

- Removed KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING macro.
- Standardized MAX_GROUPS to 10 in W3DDisplayStringManager.
- Removed debug numeral formatting and aircraft carrier deck indexing logic.
- Cleaned up associated conditional includes and code blocks.
@greptile-apps

greptile-apps Bot commented Mar 19, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes the never-active KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING macro and all code guarded by it across both the Generals and GeneralsMD trees. Because the #define was already commented out in every file, this is a pure dead-code cleanup with no behavioral change.

  • W3DDisplayStringManager.h (×2): Conditional MAX_GROUPS 20/10 block replaced with an unconditional #define MAX_GROUPS 10.
  • W3DDisplayStringManager.cpp (×2): Debug Unicode numeral-format path removed; only the production AsciiString/TheGameText->fetch path remains. Both files have a minor whitespace artifact (leading space before tab) on the three surviving lines — a leftover from their former #else-block indentation.
  • Drawable.cpp: Conditional #include for ParkingPlaceBehavior.h, the extra drawUIText() call in drawIconUI(), and the full carrier-deck-index rendering block at the tail of drawUIText() are all removed cleanly. drawUIText() continues to be invoked via the normal GameClient text-bearing-drawable loop.

Confidence Score: 5/5

  • This PR is safe to merge — all removed code was already dead (macro was commented out) and no production paths are affected.
  • All changes are removal of code that was already compiled out. MAX_GROUPS value (10) is unchanged from the previously active branch of the conditional. drawUIText() retains its normal call site in GameClient.cpp. The only note is a minor pre-existing whitespace artifact on three lines in both W3DDisplayStringManager.cpp files.
  • No files require special attention.

Important Files Changed

Filename Overview
Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplayStringManager.h Removes the commented-out KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING macro and its conditional MAX_GROUPS definition, replacing the whole block with a simple #define MAX_GROUPS 10. Clean change — no behavioral impact as the macro was already inactive.
GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DDisplayStringManager.h Mirrors the Generals header change: removes the dead-code macro and conditional MAX_GROUPS block, leaving #define MAX_GROUPS 10 unconditionally. No behavioral change.
Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp Removes the #ifdef guarded debug path (Unicode format string for deck indices) leaving only the production AsciiString/TheGameText->fetch path. Minor: the three retained lines carry a residual leading space from their former #else-block indentation.
GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp Identical cleanup to the Generals counterpart. Same residual leading-space indentation artifact on the three retained lines.
GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp Removes the conditional #include "GameLogic/Module/ParkingPlaceBehavior.h", the debug drawUIText() call inside drawIconUI(), and the full deck-index display block at the end of drawUIText(). drawUIText() itself is retained and continues to be called through the normal GameClient text-bearing drawable path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[W3DDisplayStringManager::postProcessLoad] -->|loop i=0..MAX_GROUPS-1| B[newDisplayString]
    B --> C[setFont]
    C --> D["AsciiString::format('NUMBER:%d', i)"]
    D --> E["setText(TheGameText->fetch(displayNumber))"]

    F[GameClient render loop] -->|addTextBearingDrawable| G[Drawable::drawUIText]
    G --> H{obj in group?}
    H -->|yes| I[getGroupNumeralString / draw numeral]
    H -->|no| J{obj in formation?}
    J -->|yes| K[getFormationLetterString / draw letter]

    subgraph REMOVED ["Removed debug path (was inside #ifdef)"]
        R1["#include ParkingPlaceBehavior.h"]
        R2["drawIconUI → drawUIText (extra call)"]
        R3["drawUIText → deck-index display block"]
    end

    style REMOVED fill:#ffcccc,stroke:#cc0000
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp
Line: 86-88

Comment:
**Residual leading space in indentation**

After removing the `#ifdef`/`#else` wrapper, these three lines retained the leading space that preceded their tab indentation inside the `#else` block. The surrounding code (e.g. lines 84–85) uses tab-only indentation, so these lines are now inconsistently indented.

```suggestion
		AsciiString displayNumber;
		displayNumber.format("NUMBER:%d", i);
		m_groupNumeralStrings[i]->setText(TheGameText->fetch(displayNumber));
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplayStringManager.cpp
Line: 86-88

Comment:
**Residual leading space in indentation**

Same whitespace artifact as the Generals counterpart — after removing the `#ifdef`/`#else` wrapper, these lines kept the leading space that was part of their original `#else`-block indentation. All surrounding lines in the loop use tab-only indentation.

```suggestion
		AsciiString displayNumber;
		displayNumber.format("NUMBER:%d", i);
		m_groupNumeralStrings[i]->setText(TheGameText->fetch(displayNumber));
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "feat: Remove aircraf..."

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

Good call

@xezon xezon changed the title feat: Remove aircraft carrier debugging hack chore: Remove debug code for KRIS_BRUTAL_HACK_FOR_AIRCRAFT_CARRIER_DEBUGGING Mar 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.

Brutal.

@xezon xezon added Debug Is mostly debug functionality Minor Severity: Minor < Major < Critical < Blocker labels Mar 21, 2026
@xezon
xezon merged commit ce899fa into TheSuperHackers:main Mar 21, 2026
23 checks passed
@mirelle7
mirelle7 deleted the feature/remove-aircraft-carrier-hack branch March 22, 2026 16:53
atraber pushed a commit to atraber/GeneralsGameCode that referenced this pull request Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Debug Is mostly debug functionality Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants