Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

room: test sector range for Torso boss #1497

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- fixed `/tp` console command reporting teleport fails as success (#1484, regression from 4.1)
- fixed console commands causing improper ring shutdown with selected inventory item (#1460, regression from 3.0)
- fixed console input immediately ending demo (#1480, regression from 4.1)
- fixed a potential softlock when killing the Torso boss in Great Pyramid (#1236)
- changed `/tp` console command to look for the closest place to teleport to when targeting items (#1484)
- improved appearance of textures around edges when bilinear filter is off (#1483)
Since this removes the seams on pushblocks, this was made optional.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
- fixed looking forward too far causing an upside down camera frame
- fixed the Scion being extremely difficult to shoot with the shotgun
- fixed collision issues with drawbridges, trapdoors, and bridges when stacked over each other, over slopes, and near the ground
- fixed a potential softlock when killing the Torso boss in Great Pyramid

#### Cheats
- added a fly cheat
Expand Down
29 changes: 27 additions & 2 deletions src/game/room.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ static int16_t Room_GetCeilingTiltHeight(
const SECTOR_INFO *sector, const int32_t x, const int32_t z);
static SECTOR_INFO *Room_GetSkySector(
const SECTOR_INFO *sector, int32_t x, int32_t z);
static void Room_TestSectorTrigger(
const ITEM_INFO *item, const SECTOR_INFO *sector);

static void Room_TriggerMusicTrack(int16_t track, const TRIGGER *const trigger)
{
Expand Down Expand Up @@ -736,11 +738,34 @@ void Room_PopulateSectorData(

void Room_TestTriggers(const ITEM_INFO *const item)
{
const bool is_heavy = item->object_id != O_LARA;
int16_t room_num = item->room_num;
const SECTOR_INFO *const sector =
const SECTOR_INFO *sector =
Room_GetSector(item->pos.x, MAX_HEIGHT, item->pos.z, &room_num);

Room_TestSectorTrigger(item, sector);
if (item->object_id != O_TORSO) {
return;
}

for (int32_t dx = -1; dx < 2; dx++) {
for (int32_t dz = -1; dz < 2; dz++) {
if (!dx && !dz) {
continue;
}

room_num = item->room_num;
sector = Room_GetSector(
item->pos.x + dx * WALL_L, MAX_HEIGHT,
item->pos.z + dz * WALL_L, &room_num);
Room_TestSectorTrigger(item, sector);
}
}
}

static void Room_TestSectorTrigger(
const ITEM_INFO *const item, const SECTOR_INFO *const sector)
{
const bool is_heavy = item->object_id != O_LARA;
if (!is_heavy && sector->is_death_sector && Lava_TestFloor(item)) {
Lava_Burn(g_LaraItem);
}
Expand Down