p_doors: route locked-door messages through DEH_String#138
Open
Copilot wants to merge 3 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/sunsided/room/sessions/0f360341-019e-4a59-a339-87ac4be21cff Co-authored-by: sunsided <495335+sunsided@users.noreply.github.com>
Agent-Logs-Url: https://github.com/sunsided/room/sessions/0f360341-019e-4a59-a339-87ac4be21cff Co-authored-by: sunsided <495335+sunsided@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded messages in EV_DoLockedDoor and EV_VerticalDoor
p_doors: route locked-door messages through DEH_String
May 21, 2026
There was a problem hiding this comment.
Pull request overview
This PR restores the original Doom/Chocolate Doom behavior for key-locked door/object failure prompts by routing all lock messages through DEH_String(PD_*) indirection (instead of embedding hardcoded English literals at each call site). This ensures DeHackEd-style string replacement can be applied consistently in the Rust port, matching the C implementation’s string-table pattern.
Changes:
- Added
PD_*lock-message constants for locked objects and locked doors inp_doors.rs. - Centralized special-to-message selection via
locked_object_message()/locked_door_message()and used them inEV_DoLockedDoorandEV_VerticalDoor. - Added unit tests validating that each locked special maps to the expected
DEH_String(PD_*)message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
324
to
+330
| match (*line).special as c_int { | ||
| 99 | 133 => { | ||
| if p.is_null() { | ||
| return 0; | ||
| } | ||
| if (*p).cards[it_bluecard] == 0 && (*p).cards[it_blueskull] == 0 { | ||
| // FIXME: C uses DEH_String(PD_BLUEO) here; Dehacked blue-object message is not patchable. | ||
| (*p).message = cstr!("You need a blue key to activate this object"); | ||
| (*p).message = locked_object_message((*line).special as c_int); |
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.
EV_DoLockedDoorandEV_VerticalDoorwere still assigning hardcoded English lock messages, so Dehacked string replacements for key-required prompts were ignored. This aligns the Rust port with the C behavior by restoring theDEH_String(PD_*)indirection for all locked-door/object cases.What changed
PD_BLUEO,PD_REDO,PD_YELLOWO,PD_BLUEK,PD_REDK, andPD_YELLOWKconstants inroom/src/doom/p_doors.rsDEH_Stringshim instead of embedding literals at the call sitesCall-site cleanup
99/133,134/135,136/137)26/32,27/34,28/33)Regression coverage
p_doorstests asserting that each locked special maps to the expectedDEH_String(PD_*)messageWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/usr/lib/apt/methods/https /usr/lib/apt/methods/https relro -o /home/REDACTED/work/room/room/target/debug/build/khronos-egl-70a2b76c9628275f/build_script_build-70a2b76c9628275f lib/�� 0779cc9eccb950/r/home/REDACTED/work/room/room/target/debug/build/naga-f2cede7214b0b354/build_scrip/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc 0779cc9eccb950/b-Wl,--as-needed lib/rustlib/x86_64-REDACTED-linux-gnu/bin/gcc-ld/ld.lld(dns block)If you need me to access, download, or install something from one of these locations, you can either: