unify(collide): Move collision modules to Core - #3209
Conversation
9de465a to
f64d045
Compare
PR Summary by QodoCentralize collision modules in Core
AI Description
Diagram
High-Level Assessment
Files changed (44)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding |
Skyaero42
left a comment
There was a problem hiding this comment.
ZH has multiple files that are not in generals, but are in the Helper directory. These should also be moved. The remaining CrateCollide files only have minor differences and can be merged.
It is better that a (merge)/move is clearly scope - e.g. per theme or directory - rather than individual files.
f64d045 to
34c371f
Compare
34c371f to
d9c4ea6
Compare
I have updated this PR. Hopefully I got the game guards right. |
|
Code review by qodo was updated up to the latest commit d9c4ea6 |
|
| Filename | Overview |
|---|---|
| Core/GameEngine/CMakeLists.txt | Adds the unified collision files to the shared interface source set, allowing each variant target to compile them with its own definitions. |
| Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/CrateCollide.cpp | Preserves shared crate validation and confines parachute and sabotage feedback behavior to Zero Hour. |
| Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/ConvertToHijackedVehicleCrateCollide.cpp | Retains the differing Generals and Zero Hour hijacking rules through correctly directed compile-time guards. |
| Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/MoneyCrateCollide.cpp | Keeps Zero Hour's upgraded supply boost while preserving Generals' original money-crate calculation. |
| Core/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SalvageCrateCollide.cpp | Preserves Zero Hour armor salvage and academy statistics without exposing them to Generals. |
| Generals/Code/GameEngine/CMakeLists.txt | Removes the now-shared collision files from the Generals variant source set. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Removes the now-shared collision files from the Zero Hour variant source set. |
| scripts/cpp/unify_move_files.py | Adds commented records of the collision-family unification operations without changing executable script behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Shared[Core collision sources] --> GI[Generals target interface]
Shared --> ZI[Zero Hour target interface]
GI -->|RTS_GENERALS| G[g_gameengine]
ZI -->|RTS_ZEROHOUR| Z[z_gameengine]
G --> Common[Shared collision behavior]
Z --> Common
Z --> ZH[Zero Hour-only guarded behavior]
Reviews (1): Last reviewed commit: "unify(collide): Move collision modules t..." | Re-trigger Greptile
This merges the collision module family and moves it into Core.
Shared by Generals and Zero Hour:
CollideModuleConvertToCarBombCrateCollideConvertToHijackedVehicleCrateCollideCrateCollideFireWeaponCollideHealCrateCollideMoneyCrateCollideSalvageCrateCollideShroudCrateCollideSquishCollideUnitCrateCollideVeterancyCrateCollideZero Hour-only sabotage modules:
SabotageCommandCenterCrateCollideSabotageFakeBuildingCrateCollideSabotageInternetCenterCrateCollideSabotageMilitaryFactoryCrateCollideSabotagePowerPlantCrateCollideSabotageSuperweaponCrateCollideSabotageSupplyCenterCrateCollideSabotageSupplyDropzoneCrateCollideThe shared implementations preserve Generals behavior while retaining Zero Hour-specific collision behavior behind
RTS_ZEROHOURguards. The one-sided sabotage modules are whole-file guarded because they depend on Zero Hour-only interfaces and systems.Validation