refactor: Add override keyword to virtual function overrides in GameEngine#2391
Merged
xezon merged 6 commits intoTheSuperHackers:mainfrom Mar 13, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h | Added override to getDie() and added missing virtual to onDie(), but onDie() is missing override for consistency with the rest of the PR. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DieModule.h | Same as Generals counterpart — virtual added to onDie() but override omitted; otherwise mechanical override additions are correct. |
| Generals/Code/GameEngine/Include/GameLogic/Module/BehaviorModule.h | All virtual overrides in the BehaviorModule base correctly received override; non-override methods like getStealth() were appropriately left unchanged. |
| GeneralsMD/Code/GameEngine/Include/GameLogic/Module/BehaviorModule.h | Consistent with Generals counterpart; getStealth() and getSpyVisionUpdate() (first declarations in hierarchy) correctly left without override. |
| Generals/Code/GameEngine/Include/GameLogic/Module/AIUpdate.h | Mechanical override additions to getAIUpdateInterface(), getDisabledTypesToProcess(), onObjectCreated(), aiDoCommand(), update(), and getUpdatePhase() look correct. |
| Generals/Code/GameEngine/Include/GameLogic/Module/DestroyModule.h | override added to getDestroy(); the pure virtual onDestroy() which already had virtual was correctly left unchanged (consistent in that it wasn't touched, unlike the DieModule case). |
| GeneralsMD/Code/GameEngine/Include/GameLogic/Module/AIUpdate.h | Correct mechanical override additions mirroring the Generals version. |
| Generals/Code/GameEngine/Include/GameLogic/Module/ActiveBody.h | Large number of override additions to body-module overrides; all changes appear correct and consistent. |
Class Diagram
%%{init: {'theme': 'neutral'}}%%
classDiagram
class DieModuleInterface {
+virtual onDie(damageInfo) = 0
}
class BehaviorModule {
+virtual getDie() override
}
class DieModule {
+virtual getDie() override
+virtual onDie(damageInfo) = 0 %% missing override
}
class CrushDie {
+virtual onDie(damageInfo) override
}
class DestroyDie {
+virtual onDie(damageInfo) override
}
class FXListDie {
+virtual onDie(damageInfo) override
}
BehaviorModule <|-- DieModule
DieModuleInterface <|-- DieModule
DieModule <|-- CrushDie
DieModule <|-- DestroyDie
DieModule <|-- FXListDie
Prompt To Fix All With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngine/Include/GameLogic/Module/DieModule.h
Line: 100
Comment:
**Missing `override` on re-declared pure virtual**
This line previously read `void onDie( const DamageInfo *damageInfo ) = 0;` (without `virtual`). This PR correctly restores the `virtual` keyword, but unlike the rest of the changes in this PR the `override` specifier was not added. Since `DieModule` inherits from `DieModuleInterface`, which declares `virtual void onDie( const DamageInfo *damageInfo ) = 0;`, the re-declaration in `DieModule` is an override of that pure virtual and should carry `override` for consistency with every other modified declaration in this PR.
The same issue exists in `GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DieModule.h` at line 100.
```suggestion
virtual void onDie( const DamageInfo *damageInfo ) override = 0;
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 9af9679
…des in GameLogic/Module
…s in GameLogic/Module
89af460 to
aa5c2ff
Compare
xezon
reviewed
Mar 10, 2026
xezon
left a comment
There was a problem hiding this comment.
override = 0 needs looking into. For all refactors of this kind.
Generals/Code/GameEngine/Include/GameLogic/Module/BridgeBehavior.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Include/GameLogic/Module/BridgeTowerBehavior.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Include/GameLogic/Module/CollideModule.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Include/GameLogic/Module/DamageModule.h
Outdated
Show resolved
Hide resolved
…odule abstract classes
…n GameLogic modules
Skyaero42
reviewed
Mar 11, 2026
Generals/Code/GameEngine/Include/GameLogic/Module/DeliverPayloadAIUpdate.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Include/GameLogic/Module/DeliverPayloadAIUpdate.h
Outdated
Show resolved
Hide resolved
Generals/Code/GameEngine/Include/GameLogic/Module/DeliverPayloadAIUpdate.h
Outdated
Show resolved
Hide resolved
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/Include/GameLogic/ModuleContext
Part 3/6 of splitting #2101. Depends on #2389 merging first.
Notes
overridekeyword additionsvirtualkeyword