refactor: Add override keyword to virtual function overrides in GameEngine (2)#2392
Merged
xezon merged 8 commits intoTheSuperHackers:mainfrom Mar 18, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/Common/GameAudio.h | Adds override to all virtual overrides in AudioManager and AudioManagerDummy, except audioDebugDisplay in AudioManagerDummy which was skipped (inside #if defined(RTS_DEBUG) block). |
| Generals/Code/GameEngine/Include/GameLogic/ScriptActions.h | Promotes executeAction, closeWindows, and doEnableOrDisableObjectDifficultyBonuses to virtual … override, fixing a real polymorphism issue where these pure-virtual overrides lacked virtual; also fixes the destructor chain. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/ScriptActions.h | Same polymorphism bugfix as the Generals counterpart — executeAction, closeWindows, and doEnableOrDisableObjectDifficultyBonuses are now correctly virtual … override. |
| Generals/Code/GameEngine/Include/GameLogic/ScriptConditions.h | Promotes evaluateCondition, evaluateTeamIsContained, and evaluateSkirmishCommandButtonIsReady — all pure-virtual overrides that previously lacked virtual — to virtual … override, fixing polymorphic dispatch through ScriptConditionsInterface*. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/ScriptConditions.h | Same polymorphism bugfixes as the Generals counterpart — evaluateCondition, evaluateTeamIsContained, and evaluateSkirmishCommandButtonIsReady now correctly carry virtual … override. |
| Generals/Code/GameEngine/Include/GameLogic/Scripts.h | Mechanical addition of override to crc, xfer, and loadPostProcess in ScriptGroup, Script, and ScriptList. All changes are correct. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/Scripts.h | Same mechanical override additions as the Generals counterpart. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/AIGuardRetaliate.h | Mechanical override additions to state machine virtual methods (onEnter, update, onExit, crc, xfer, loadPostProcess, shouldExit) — all correct and GeneralsMD-only. |
| Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/VictoryConditions.cpp | Promotes several non-virtual overrides (init, reset, update, hasAchievedVictory, etc.) to virtual … override, fixing polymorphic dispatch through VictoryConditionsInterface*. |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpectreGunshipUpdate.cpp | Adds override to PartitionFilterLiveMapEnemies::allow — correct and GeneralsMD-only. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class SubsystemInterface {
+virtual ~SubsystemInterface()
+virtual void init() = 0
+virtual void reset() = 0
+virtual void update() = 0
+virtual void postProcessLoad()
}
class ScriptActionsInterface {
+virtual ~ScriptActionsInterface() override
+virtual void init() = 0
+virtual void reset() = 0
+virtual void update() = 0
+virtual void executeAction() = 0
+virtual void closeWindows() = 0
+virtual void doEnableOrDisableObjectDifficultyBonuses() = 0
}
class ScriptActions {
+virtual ~ScriptActions() override
+virtual void init() override
+virtual void reset() override
+virtual void update() override
+virtual void executeAction() override
+virtual void closeWindows() override
+virtual void doEnableOrDisableObjectDifficultyBonuses() override
}
class ScriptConditionsInterface {
+virtual ~ScriptConditionsInterface() override
+virtual void init() = 0
+virtual Bool evaluateCondition() = 0
+virtual Bool evaluateTeamIsContained() = 0
+virtual Bool evaluateSkirmishCommandButtonIsReady() = 0
}
class ScriptConditions {
+virtual ~ScriptConditions() override
+virtual void init() override
+virtual Bool evaluateCondition() override
+virtual Bool evaluateTeamIsContained() override
+virtual Bool evaluateSkirmishCommandButtonIsReady() override
}
class AudioManager {
+virtual ~AudioManager() override
+virtual void init() override
+virtual void stopAudio() = 0
}
class AudioManagerDummy {
+virtual void audioDebugDisplay() [missing override]
+virtual void stopAudio() override
+virtual void pauseAudio() override
}
SubsystemInterface <|-- ScriptActionsInterface
ScriptActionsInterface <|-- ScriptActions
SubsystemInterface <|-- ScriptConditionsInterface
ScriptConditionsInterface <|-- ScriptConditions
SubsystemInterface <|-- AudioManager
AudioManager <|-- AudioManagerDummy
Prompt To Fix All With AI
This is a comment left during a code review.
Path: Core/GameEngine/Include/Common/GameAudio.h
Line: 391
Comment:
**Missing `override` on `audioDebugDisplay` in `AudioManagerDummy`**
The `audioDebugDisplay` method in `AudioManagerDummy` (line 391) was not updated with the `override` keyword, while every other virtual override in this class was updated as part of this PR. Because the method is inside a `#if defined(RTS_DEBUG)` block, it appears to have been missed during the mechanical pass.
```suggestion
virtual void audioDebugDisplay(DebugDisplayInterface* dd, void* userData, FILE* fp) override {}
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "refactor: Add missin..."
3b4cf3d to
d8471a3
Compare
Skyaero42
reviewed
Mar 12, 2026
…des in GameEngine
f2574b2 to
949b25a
Compare
xezon
reviewed
Mar 17, 2026
xezon
approved these changes
Mar 18, 2026
xezon
left a comment
There was a problem hiding this comment.
I only glanced over it and it appears to be OK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overridekeyword to virtual function overrides in GameEngine (excluding GameLogic/Module)Context
Part 4/6 of splitting #2101. Depends on #2389 merging first.
Notes
overridekeyword additionsvirtualkeyword from enum entries in Scripts.hvirtualkeyword