fix(commandxlat): Consume the cheat and demo messages consistently when handled - #3138
fix(commandxlat): Consume the cheat and demo messages consistently when handled#3138bas-slats wants to merge 1 commit into
Conversation
PR Summary by QodoFix: consume Add Cash cheat/demo messages after handling
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
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 describe a rule in plain language on the Rules page and Qodo drafts it for you |
|
There are more places where the message isn't consumed, like |
| money->deposit( 10000 ); | ||
| TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE("GUI:DebugAddCash", L"Add Cash") ); | ||
|
|
||
| // TheSuperHackers @fix Consume the message consistently with the other cheat messages. |
There was a problem hiding this comment.
Needs no comment. Debug functionality. No one will look back at it.
Yes looks like there are a couple more. |
4bcfd6f to
49682fe
Compare
|
Swept the whole |
CommandTranslator::translateGameMessagehas several cheat and demo cases that perform their action without consuming the message, unlike their sibling cases, which setdisp = DESTROY_MESSAGEwhen handled. This change consumes the message in all of them:MSG_CHEAT_ADD_CASH(the issue's subject)MSG_CHEAT_SHOW_HEALTHMSG_META_DEMO_ADD_CASHMSG_META_DEMO_TOGGLE_RENDERMSG_META_DEMO_KILL_AREA_SELECTIONMSG_META_DEMO_TOGGLE_METRICS(PERF_TIMERSbuilds)MSG_META_DEMO_PERFORM_STATISTICAL_DUMP(DUMP_PERF_STATSbuilds)Found by sweeping the whole switch for cheat/demo cases that lack a
dispassignment; the stackedRUNSCRIPTandOBJECTIVE_MOVIEblocks and the remaining cheat/demo cases already consume. Code comments are removed per review.Testing
Compiles with the
win32preset (VS2019 16.11, Ninja Multi-Config, Release);CommandXlat.cppbuilds without warnings andgeneralszh.exelinks. The two#ifdef-guarded sites are not compiled by this preset and are syntax-identical one-liners; the debug/profile CI presets exercise them.An earlier build of this branch (with the two add cash changes) was smoke tested in game against retail Steam Zero Hour 1.04 data: boots, loads and plays a skirmish normally. The cheat messages are not bound in normal builds, so the disposition change is verified by inspection against the sibling cases.
This change was developed with AI assistance (Claude), human-directed: every case in the switch was checked by hand for the missing disposition, and the change was verified to compile as above. No gameplay simulation code is touched.