You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unify(rts): Merge and move Common/RTS and SpecialPowerType to Core - #3733
Unifies all 32 Common/RTS files (15 Source/Common/RTS/*.cpp, their matching Include/Common/*.h, plus SpecialPowerType.h and SpecialPowerMaskType.h) into Core: first merging the copies and required Generals-side dependency stubs, then moving the identical files to Core as 100% renames. Zero Hour has no behavioral changes.
Retail-compatible Generals game logic, CRC, network, and save formats are preserved via guards. Player-level vision spying and Player::onStructureConstructionComplete EVA superweapon messages stay under RTS_GENERALS until Object, SpyVisionUpdate, and Eva are unified.
Verification: Full VC6 and Win32 builds pass. Retail replays pass with VC6: Generals 1.08 (6/6, 0 errors) and Zero Hour 1.04 (10/10, 0 errors).
Generals Changes (Retail Compatible)
UI (InGameUI / ControlBar)
ActionManager::canHijackVehicle rejects KINDOF_DRONE targets so hijackers no longer show a hijack cursor on drones.
ActionManager::canFireWeaponAtObject enforces canSnipeVehicle (which also rejects drones) and checks only the requested weapon slot for DAMAGE_KILLPILOT weapon commands.
Player::becomingLocalPlayer, attemptToPurchaseScience, addUpgrade, and removeUpgrade call TheControlBar->markUIDirty() for the local player.
Data-dependent behavior
SpecialPowerType, SpecialPowerMaskType::s_bitNameList, and ActionManager targeting switches now include the Zero Hour special powers for custom data/mods, in Zero Hour's enum order (the order does not reach saves, CRC, or network messages).
ActionManager::canEnterObject blocks KINDOF_REJECT_UNMANNED infantry from entering unmanned vehicles, and SPECIAL_DISGUISE_AS_VEHICLE rejects KINDOF_CLIFF_JUMPER targets.
ActionManager::getCanAttackObject falls back to getClosestRider on KINDOF_SPAWNS_ARE_THE_WEAPONS objects that have a ContainModule and no SpawnBehavior.
Generals Changes (Only with Retail Compatibility Off)
Guarded under RETAIL_COMPATIBLE_CRC to preserve retail simulation/AI/script behavior:
ActionManager::getCanAttackObject rejects CMD_FROM_PLAYER attacks when no weapon slot has a non-zero AutoChooseSources command source mask.
ActionManager capture/hacking checks, Team::getTeamTargetObject, and TunnelTracker::getCurNemesis no longer treat disguised (OBJECT_STATUS_DISGUISED) targets as untargetable when stealthed and undetected.
ActionManager::canDoSpecialPowerAtLocation validates SPECIAL_SPY_SATELLITE, SPECIAL_RADAR_VAN_SCAN, and SPECIAL_SPY_DRONE coordinates with isPointOnMap.
Team::getTeamTargetObject ignores KINDOF_AIRCRAFT as a shared team target.
Player::sellEverythingUnderTheSun sells only faction structures, command centers, and power plants rather than all player objects.
Player::update syncs m_logicalRetaliationModeEnabled via MSG_ENABLE_RETALIATION_MODE (RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_NETWORKING; ActiveBody in Generals does not yet read the flag).
Energy::xfer saves version 3 with m_powerSabotagedTillFrame (RETAIL_COMPATIBLE_XFER_SAVE, otherwise stays at version 2).
Other
Added Generals-only declarations/helpers needed by unified Common/RTS in CollideModule.h, CrateCollide.h, MinefieldBehavior.h, OpenContain.h, PhysicsUpdate.h, ToppleUpdate.h, ContainModule.h, SpecialPowerModule.h, Object.{h,cpp}, WeaponSet.{h,cpp}, AIPlayer.{h,cpp}, and AISkirmishPlayer.{h,cpp}.
Updated Core, Generals, and GeneralsMDGameEngine/CMakeLists.txt and recorded the moved files in scripts/cpp/unify_move_files.py.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The PR moves shared RTS headers and implementations into Core and changes build-specific compatibility behavior. It also changes Generals vision-spying state, AI targeting and building-placement APIs, gameplay module queries, and weapon-slot attack checks.
Core’s build list activates shared RTS headers and sources. The Generals and GeneralsMD build lists exclude selected entries. The previous Generals copies are deleted, and the move script records commented-out calls for file moves.
Retail-compatible gameplay and save rules Core/GameEngine/Include/Common/SpecialPowerType.h, Core/GameEngine/Source/Common/RTS/ActionManager.cpp, Core/GameEngine/Source/Common/RTS/Energy.cpp, Core/GameEngine/Source/Common/RTS/Player.cpp, Core/GameEngine/Source/Common/RTS/SpecialPower.cpp, Core/GameEngine/Source/Common/RTS/Team.cpp, Core/GameEngine/Source/Common/RTS/TunnelTracker.cpp
Build conditions change action eligibility, target filtering, special-power enum ordering, energy transfer versioning, player behavior, and team and tunnel target checks.
Track and transfer player vision-spying state Core/GameEngine/Include/Common/Player.h, Core/GameEngine/Source/Common/RTS/Player.cpp
Generals builds add per-player vision-spying reference counts and a mask. Player initialization, map initialization, updates, and transfer data handle this state.
AI and skirmish-player methods return a Boolean targeting result. The cluster-mines branch returns true after selecting a target.
Search for construction locations Generals/Code/GameEngine/Include/GameLogic/AIPlayer.h, Generals/Code/GameEngine/Include/GameLogic/Module/SpecialPowerModule.h, Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp
AIPlayer adds methods to search for legal construction locations and build near a team. SpecialPowerModuleInterface exposes the final-product template for construction sites.
Gameplay module capability queries
Layer / File(s)
Summary
Add collision and containment queries Generals/Code/GameEngine/Include/GameLogic/Module/*.h
Module interfaces add queries for sabotage-building crate collisions and rider-change containment. The listed module classes return false for the new checks.
Object and WeaponSet declarations add optional weapon-slot arguments for attack checks and expose a slot’s command-source mask.
Forward and apply the selected slot Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp, Generals/Code/GameEngine/Source/GameLogic/Object/WeaponSet.cpp
Object forwards the selected slot to WeaponSet. WeaponSet checks that slot when specified and retains its all-slots behavior when no slot is specified.
TheSuperHackers/GeneralsGameCode#3646 — The PR changes retaliation-mode polling and message emission under retail-compatible build conditions in Player.cpp; the summaries do not confirm whether this fully enforces the issue’s live-match-only requirement.
Suggested reviewers: xezon, bobtista, caball009
Merge Risk: Low · up to 85c94
This PR moves shared RTS code into Core and adds Generals support for behavior that already exists in Zero Hour. Six minor edge-case issues in attack validation and AI building placement are noted, and none blocks the merge. Author-reported replay checks pass, so merge risk is low.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the Common/RTS files and SpecialPowerType are merged and moved from GeneralsMD to Core under the unify effort. It is short, specific, and matches the changeset. The ti…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is specific and related to the changeset. It states that 32 Common/RTS files are unified into Core as renames. It lists the Generals behavior changes under RETAIL_COMPATIBLE_CRC and ne…
Full details: Title check
Explanation
The title names the main change: the Common/RTS files and SpecialPowerType are merged and moved from GeneralsMD to Core under the unify effort. It is short, specific, and matches the changeset. The title does not mention the Generals-side guarded behavior changes, which is acceptable because the title need not cover every detail.
Full details: Description check
Explanation
The description is specific and related to the changeset. It states that 32 Common/RTS files are unified into Core as renames. It lists the Generals behavior changes under RETAIL_COMPATIBLE_CRC and network/save guards. It also names the CMakeLists.txt updates, the unify_move_files.py script, and the verification builds and replays. It describes the changes in the raw summary, so the description is not off-topic or generic.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Jaredl-Dev
changed the title
unify(rts): Unify Common/RTS and SpecialPowerType in Core
unify(rts): Merge and move Common/RTS and SpecialPowerType to Core
Nov 28, 2026
Jaredl-Dev
added a commit
to Jaredl-Dev/GeneralsGameCode
that referenced
this pull request
Nov 28, 2026
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Why does RETAIL_COMPATIBLE_NETWORKING take part in the enum position gate? I can see why CRC matters, but I could not find a network payload that carries a SpecialPowerType value.
The reason will be displayed to describe this comment to others. Learn more.
Yes this looks suspicious. I suggest ask Claude why it picked it. If its reason is bogus, remove.
Then improve comment at
// Disable non retail fixes in the networking, such as putting more data per UDP packet
#ifndef RETAIL_COMPATIBLE_NETWORKING
#defineRETAIL_COMPATIBLE_NETWORKING (1)
#endif
And explain the RETAIL_COMPATIBLE_* macros a bit better in the SKILL.md
The reason will be displayed to describe this comment to others. Learn more.
Checked the move commit against the merge commit. The 32 files are pure renames, and the Generals and Zero Hour copies were identical apart from the license header. Zero Hour only gains RTS_GENERALS gates. The Generals behavior changes are either UI-only or gated. Looks good to me.
The reason will be displayed to describe this comment to others. Learn more.
This is temporary until Object and SpyVisionUpdate are unified: the Zero Hour version calls Object::setVisionSpied, which Generals' Object doesn't have yet.
The reason will be displayed to describe this comment to others. Learn more.
Yes this looks suspicious. I suggest ask Claude why it picked it. If its reason is bogus, remove.
Then improve comment at
// Disable non retail fixes in the networking, such as putting more data per UDP packet
#ifndef RETAIL_COMPATIBLE_NETWORKING
#defineRETAIL_COMPATIBLE_NETWORKING (1)
#endif
And explain the RETAIL_COMPATIBLE_* macros a bit better in the SKILL.md
Jaredl-Dev
added a commit
to Jaredl-Dev/GeneralsGameCode
that referenced
this pull request
Nov 28, 2026
Updated: removed the SpecialPowerType order guards, narrowed the six DISGUISED guards, and removed the helper guards. VC6/Win32 builds pass; retail replays pass (Generals 6/6, Zero Hour 10/10).
I'd like to have these changes checked against a couple of thousand replays (GEN and ZH) before it gets merged.
@Skyaero42 is that something you can do? If not, I can do it myself. Probably best to wait a bit until reviewers update their reviews.
Agree and can do after all review comments have been addressed.
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
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.
Unifies all 32
Common/RTSfiles (15Source/Common/RTS/*.cpp, their matchingInclude/Common/*.h, plusSpecialPowerType.handSpecialPowerMaskType.h) intoCore: first merging the copies and required Generals-side dependency stubs, then moving the identical files toCoreas 100% renames. Zero Hour has no behavioral changes.Retail-compatible Generals game logic, CRC, network, and save formats are preserved via guards. Player-level vision spying and
Player::onStructureConstructionCompleteEVA superweapon messages stay underRTS_GENERALSuntilObject,SpyVisionUpdate, andEvaare unified.Verification: Full VC6 and Win32 builds pass. Retail replays pass with VC6: Generals 1.08 (
6/6,0errors) and Zero Hour 1.04 (10/10,0errors).Generals Changes (Retail Compatible)
UI (
InGameUI/ControlBar)ActionManager::canHijackVehiclerejectsKINDOF_DRONEtargets so hijackers no longer show a hijack cursor on drones.ActionManager::canFireWeaponAtObjectenforcescanSnipeVehicle(which also rejects drones) and checks only the requested weapon slot forDAMAGE_KILLPILOTweapon commands.Player::becomingLocalPlayer,attemptToPurchaseScience,addUpgrade, andremoveUpgradecallTheControlBar->markUIDirty()for the local player.Data-dependent behavior
SpecialPowerType,SpecialPowerMaskType::s_bitNameList, andActionManagertargeting switches now include the Zero Hour special powers for custom data/mods, in Zero Hour's enum order (the order does not reach saves, CRC, or network messages).ActionManager::canEnterObjectblocksKINDOF_REJECT_UNMANNEDinfantry from entering unmanned vehicles, andSPECIAL_DISGUISE_AS_VEHICLErejectsKINDOF_CLIFF_JUMPERtargets.ActionManager::getCanAttackObjectfalls back togetClosestRideronKINDOF_SPAWNS_ARE_THE_WEAPONSobjects that have aContainModuleand noSpawnBehavior.Generals Changes (Only with Retail Compatibility Off)
Guarded under
RETAIL_COMPATIBLE_CRCto preserve retail simulation/AI/script behavior:ActionManager::canGetRepairedAtrejects immobile objects (!obj->isMobile()).ActionManager::getCanAttackObjectrejectsCMD_FROM_PLAYERattacks when no weapon slot has a non-zeroAutoChooseSourcescommand source mask.ActionManagercapture/hacking checks,Team::getTeamTargetObject, andTunnelTracker::getCurNemesisno longer treat disguised (OBJECT_STATUS_DISGUISED) targets as untargetable when stealthed and undetected.ActionManager::canDoSpecialPowerAtLocationvalidatesSPECIAL_SPY_SATELLITE,SPECIAL_RADAR_VAN_SCAN, andSPECIAL_SPY_DRONEcoordinates withisPointOnMap.Team::getTeamTargetObjectignoresKINDOF_AIRCRAFTas a shared team target.Player::sellEverythingUnderTheSunsells only faction structures, command centers, and power plants rather than all player objects.Player::canBuildenforcescanBuildMoreOfType(tmplate)limits (matchingBuildAssistant::canMakeUnit).Guarded for network/save format compatibility:
Player::updatesyncsm_logicalRetaliationModeEnabledviaMSG_ENABLE_RETALIATION_MODE(RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_NETWORKING;ActiveBodyin Generals does not yet read the flag).Energy::xfersaves version 3 withm_powerSabotagedTillFrame(RETAIL_COMPATIBLE_XFER_SAVE, otherwise stays at version 2).Other
Common/RTSinCollideModule.h,CrateCollide.h,MinefieldBehavior.h,OpenContain.h,PhysicsUpdate.h,ToppleUpdate.h,ContainModule.h,SpecialPowerModule.h,Object.{h,cpp},WeaponSet.{h,cpp},AIPlayer.{h,cpp}, andAISkirmishPlayer.{h,cpp}.Core,Generals, andGeneralsMDGameEngine/CMakeLists.txtand recorded the moved files inscripts/cpp/unify_move_files.py.