console/pos: show flipped room when applicable
Some checks are pending
Run code linters / Run code linters (push) Waiting to run
Publish a pre-release / Build TR1 (push) Has been skipped
Publish a pre-release / Build TR2 (push) Has been skipped
Publish a pre-release / Create a prerelease (push) Has been skipped

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.
This commit is contained in:
lahm86 2025-04-19 20:40:08 +01:00
parent 51af4233be
commit 092fe1dc70
3 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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)

View file

@ -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,