room: fix abyss height check

As Lara's position is stored as int32, we need to use the same in the
abyss height check function, otherwise internal casting yields invalid
results.

Resolves #2874.
This commit is contained in:
lahm86 2025-04-27 12:19:16 +01:00
parent 2cd998673f
commit 8b78a7f001
4 changed files with 4 additions and 2 deletions

View file

@ -40,6 +40,7 @@
- fixed Lara at times ending up in incorrect rooms when using the teleport cheat (#2486, regression from 3.0) - 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) - fixed the `/pos` console command reporting the base room number when Lara is actually in a flipped room (#2487, regression from 3.0)
- fixed clicks in audio sounds (#2846, regression from 2.0) - fixed clicks in audio sounds (#2846, regression from 2.0)
- fixed Lara being killed if she enters the void in a level that uses the `disable_floor` sequence in the game flow (#2874, regression from 4.9)
- improved bubble appearance (#2672) - improved bubble appearance (#2672)
- improved rendering performance - improved rendering performance
- improved pause exit dialog - it can now be canceled with escape - improved pause exit dialog - it can now be canceled with escape

View file

@ -2,6 +2,7 @@
- added aliases to CLI options (`-gold` becomes `-g/--gold`) - added aliases to CLI options (`-gold` becomes `-g/--gold`)
- added a `--help` CLI option (may not output anything on Windows machines  OS bug) - added a `--help` CLI option (may not output anything on Windows machines  OS bug)
- changed the sound dialog appearance (repositioned, added text labels and arrows) - changed the sound dialog appearance (repositioned, added text labels and arrows)
- fixed Lara being killed if she enters the void in a level that uses the `disable_floor` sequence in the game flow (#2874, regression from 0.10)
## [1.0.2](https://github.com/LostArtefacts/TRX/compare/tr2-1.0.1...tr2-1.0.2) - 2025-04-26 ## [1.0.2](https://github.com/LostArtefacts/TRX/compare/tr2-1.0.1...tr2-1.0.2) - 2025-04-26
- changed The Golden Mask strings to default to the OG strings file for the main tables (#2847) - changed The Golden Mask strings to default to the OG strings file for the main tables (#2847)

View file

@ -550,7 +550,7 @@ void Room_SetAbyssHeight(const int16_t height)
CLAMPG(m_AbyssMaxHeight, MAX_HEIGHT - STEP_L); CLAMPG(m_AbyssMaxHeight, MAX_HEIGHT - STEP_L);
} }
bool Room_IsAbyssHeight(const int16_t height) bool Room_IsAbyssHeight(const int32_t height)
{ {
return m_AbyssMinHeight != 0 && height >= m_AbyssMinHeight; return m_AbyssMinHeight != 0 && height >= m_AbyssMinHeight;
} }

View file

@ -43,7 +43,7 @@ SECTOR *Room_GetPitSector(const SECTOR *sector, int32_t x, int32_t z);
SECTOR *Room_GetSkySector(const SECTOR *sector, int32_t x, int32_t z); SECTOR *Room_GetSkySector(const SECTOR *sector, int32_t x, int32_t z);
void Room_SetAbyssHeight(int16_t height); void Room_SetAbyssHeight(int16_t height);
bool Room_IsAbyssHeight(int16_t height); bool Room_IsAbyssHeight(int32_t height);
HEIGHT_TYPE Room_GetHeightType(void); HEIGHT_TYPE Room_GetHeightType(void);
int16_t Room_GetHeight(const SECTOR *sector, int32_t x, int32_t y, int32_t z); int16_t Room_GetHeight(const SECTOR *sector, int32_t x, int32_t y, int32_t z);
int16_t Room_GetHeightEx( int16_t Room_GetHeightEx(