refactor(metaevent): Move meta event type asserts from key event update to engine initialization#2590
refactor(metaevent): Move meta event type asserts from key event update to engine initialization#2590xezon wants to merge 2 commits intoTheSuperHackers:mainfrom
Conversation
…te to engine initialization
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/GameEngine/Include/GameClient/MetaEvent.h | Removes static from generateMetaMap() declaration and adds new verifyMetaMap() method; straightforward and correct. |
| GeneralsMD/Code/GameEngine/Source/Common/GameEngine.cpp | Moves generateMetaMap() to after debug/demo INI loads and adds verifyMetaMap() call — ordering is correct and directly addresses the previous review concern. |
| GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/MetaEvent.cpp | Removes hot-path assertion from translateGameMessage, de-static-ifies generateMetaMap() (replacing TheMetaMap-> with this->), and adds verifyMetaMap() with the equivalent #ifdef DEBUG_CRASHING guard. |
Sequence Diagram
sequenceDiagram
participant GE as GameEngine::init()
participant MM as TheMetaMap (MetaMap)
participant INI as INI Loader
GE->>MM: initSubsystem (loads CommandMap.ini)
GE->>INI: loadFileDirectory(CommandMapDebug) [#ifdef RTS_DEBUG]
GE->>INI: loadFileDirectory(CommandMapDemo) [#ifdef _ALLOW_DEBUG_CHEATS_IN_RELEASE]
GE->>MM: generateMetaMap()
Note over MM: Fills default key bindings using this->getMetaMapRec()
GE->>MM: verifyMetaMap()
Note over MM: Asserts all records have valid meta msg types [#ifdef DEBUG_CRASHING]
Reviews (2): Last reviewed commit: "Fix placement of generateMetaMap and ver..." | Re-trigger Greptile
This change moves the meta event type asserts from the key event update to engine initialization.
Additionally function
MetaMap::generateMetaMapis no longer static. It never was supposed to be.TODO