Skip to content

fix(gameengine): Remove music tracks as prerequisite to initialize the game engine#2737

Merged
xezon merged 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-music-engine-requirement
May 19, 2026
Merged

fix(gameengine): Remove music tracks as prerequisite to initialize the game engine#2737
xezon merged 2 commits into
TheSuperHackers:mainfrom
xezon:xezon/fix-music-engine-requirement

Conversation

@xezon
Copy link
Copy Markdown

@xezon xezon commented May 19, 2026

This change removes music tracks as prerequisite to initialize the game engine. The game can now be started without the physical presence of music files. The game works normally, but without music.

@xezon xezon added Enhancement Is new feature or request Fix Is fixing something, but is not user facing labels May 19, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 19, 2026

Greptile Summary

This PR removes the isMusicAlreadyLoaded() check as a hard prerequisite for game engine and WorldBuilder initialization, allowing the game to start even when music files are absent (running silently without music instead of quitting).

  • Removes the isMusicAlreadyLoaded() virtual method declaration from AudioManager and deletes its implementation in GameAudio.cpp, eliminating the filesystem check for music track presence.
  • Removes all four call sites across both GameEngine.cpp variants and both WorldBuilder.cpp variants, fully completing the cleanup with no orphaned references remaining.

Confidence Score: 5/5

Safe to merge — the change is a clean, complete removal of a file-presence check that was blocking initialization when music files were absent.

All declaration, implementation, and call sites for isMusicAlreadyLoaded() are consistently removed across both game variants and both tool variants. A repository-wide search confirms zero remaining references, so there is no risk of compilation failures or dangling call sites.

No files require special attention.

Important Files Changed

Filename Overview
Core/GameEngine/Include/Common/GameAudio.h Removes virtual isMusicAlreadyLoaded() declaration from AudioManager; no remaining references in the codebase.
Core/GameEngine/Source/Common/Audio/GameAudio.cpp Removes the isMusicAlreadyLoaded() implementation that iterated audio events and checked for a music file on disk.
Generals/Code/GameEngine/Source/Common/GameEngine.cpp Removes isMusicAlreadyLoaded() guard that called setQuitting(TRUE) when music files were absent.
GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp Same isMusicAlreadyLoaded() guard removal as the Generals variant; symmetric and consistent.
Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp Removes early return FALSE when music files were absent in WorldBuilder init; initialization now proceeds without music.
GeneralsMD/Code/Tools/WorldBuilder/src/WorldBuilder.cpp Same WorldBuilder early-return removal as the Generals variant; symmetric and consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GameEngine::init / WorldBuilder::InitInstance] --> B[initSubsystem TheAudio]
    B --> C{Before PR:\nisMusicAlreadyLoaded?}
    C -- No --> D[setQuitting TRUE / return FALSE]
    C -- Yes --> E[Continue initialization]
    B --> F{After PR:\nNo check}
    F --> E
    E --> G[initSubsystem TheVideoPlayer, etc.]
    G --> H[Game / WorldBuilder ready]
Loading

Reviews (2): Last reviewed commit: "Also fix World builder" | Re-trigger Greptile

Comment thread Core/GameEngine/Include/Common/GameAudio.h
@xezon xezon added the Blocker Severity: Minor < Major < Critical < Blocker label May 19, 2026
@xezon
Copy link
Copy Markdown
Author

xezon commented May 19, 2026

This change also fixes the Replay Check.

Copy link
Copy Markdown

@Caball009 Caball009 left a comment

Choose a reason for hiding this comment

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

Looks ok to me. Good to see the CI Replay checker working again.

@xezon xezon merged commit 5ef7985 into TheSuperHackers:main May 19, 2026
17 checks passed
@xezon xezon deleted the xezon/fix-music-engine-requirement branch May 19, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Blocker Severity: Minor < Major < Critical < Blocker Enhancement Is new feature or request Fix Is fixing something, but is not user facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants