From 092fe1dc7029f08900bc21a08425fcd7f691f8fa Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Sat, 19 Apr 2025 20:40:08 +0100 Subject: [PATCH] console/pos: show flipped room when applicable If Lara is in a room and the flipmap is on, the console will now report the flipped room's number when using the pos command. Resolves #2487. --- docs/tr1/CHANGELOG.md | 1 + docs/tr2/CHANGELOG.md | 1 + src/libtrx/game/console/cmd/pos.c | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/tr1/CHANGELOG.md b/docs/tr1/CHANGELOG.md index e81f5e044..1cb07eb95 100644 --- a/docs/tr1/CHANGELOG.md +++ b/docs/tr1/CHANGELOG.md @@ -31,6 +31,7 @@ - fixed Story So Far showing up even when there's nothing to play (#2611, regression from 2.10) - fixed Story So Far not playing the opening FMV, `cafe.rpl` (#2779, regression from 2.10) - fixed Lara at times ending up in incorrect rooms when using the teleport cheat (#2486, regression from 3.0) +- fixed the `/pos` console command reporting the base room number when Lara is actually in a flipped room (#2487, regression from 3.0) - improved bubble appearance (#2672) - improved rendering performance - improved pause exit dialog - it can now be canceled with escape diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index e9076a98b..48f96b292 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -41,6 +41,7 @@ - fixed the camera going out of bounds in 60fps near specific invalid floor data (known as no-space) (#2764, regression from 0.10) - fixed sprites rendering black if no shade value is assigned in the level (#2701, regression from 0.8) - fixed Lara at times ending up in incorrect rooms when using the teleport cheat (#2486, regression from 0.3) +- fixed the `/pos` console command reporting the base room number when Lara is actually in a flipped room (#2487, regression from 0.3) - fixed a crash if an image was missing - fixed a crash on level load if an animation has no frames (#2746, regression from 0.8) - fixed a crash in custom levels with large rooms (#2749) diff --git a/src/libtrx/game/console/cmd/pos.c b/src/libtrx/game/console/cmd/pos.c index 34cfbb2fd..0f150fbc5 100644 --- a/src/libtrx/game/console/cmd/pos.c +++ b/src/libtrx/game/console/cmd/pos.c @@ -6,6 +6,7 @@ #include "game/game_string.h" #include "game/lara/common.h" #include "game/objects/common.h" +#include "game/rooms.h" #include "memory.h" #include "strings.h" @@ -45,10 +46,15 @@ static COMMAND_RESULT M_Entrypoint(const COMMAND_CONTEXT *const ctx) String_Format(level_type_fmt, current_level->num + reindex); const ITEM *const lara_item = Lara_GetItem(); + int16_t room_num = lara_item->room_num; + const ROOM *const room = Room_Get(room_num); + if (Room_GetFlipStatus() && room->flipped_room != NO_ROOM_NEG) { + room_num = room->flipped_room; + } char *details = lara_item == nullptr ? String_Format("%s", GS(OSD_POS_LARA_MISSING)) : String_Format( - GS(OSD_POS_LARA_POS_FMT), lara_item->room_num, + GS(OSD_POS_LARA_POS_FMT), room_num, lara_item->pos.x / (float)WALL_L, lara_item->pos.y / (float)WALL_L, lara_item->pos.z / (float)WALL_L,