Skip to content

Commit

Permalink
inject: fix Atlantean Stronghold room portals (#948)
Browse files Browse the repository at this point in the history
Adds to the Atlantean Stronghold FD injection fixes by reconfiguring
the portals between rooms 74 and 12 such that the vertices are within
the room bounds in all cases. This amends the injection function for
this to allow targeting specific doors as there are 3 in this case.
Its other use case is in Palace Midas where there is only 1 portal.

Resolves #227.
  • Loading branch information
lahm86 authored Aug 28, 2023
1 parent 7278f28 commit a914c53
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- fixed a missing enemy trigger in Tomb of Tihocan (#751)
- fixed incorrect trapdoor triggers in City of Khamoon and a switch trigger in Obelisk of Khamoon (#942)
- fixed the setup of two music triggers in St. Francis' Folly (#865)
- fixed data portal issues in Atlantean Stronghold that could result in a crash (#227)
- improve spanish localization and added translation for rotated pickups

## [2.15.3](https://github.com/rr-/Tomb1Main/compare/2.15.2...2.15.3) - 2023-08-15
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ Not all options are turned on by default. Refer to `Tomb1Main_ConfigTool.exe` fo
- **Tomb of Tihocan**: missing trigger in room 62 for enemy 34
- **City of Khamoon**: incorrect trapdoor trigger types in rooms 31 and 34
- **Obelisk of Khamoon**: missing switch trigger type in room 66
- **Atlantean Stronghold**: fixed poorly configured portals between rooms 74 and 12

#### Cheats
- added a fly cheat
Expand Down
Binary file modified bin/data/stronghold_fd.bin
Binary file not shown.
10 changes: 8 additions & 2 deletions src/game/inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,12 +1602,16 @@ static void Inject_RoomDoorEdits(INJECTION *injection)

int16_t base_room;
int16_t link_room;
int16_t door_index = -1;
int16_t x_change;
int16_t y_change;
int16_t z_change;
for (int i = 0; i < inj_info->room_door_edit_count; i++) {
File_Read(&base_room, sizeof(int16_t), 1, fp);
File_Read(&link_room, sizeof(int16_t), 1, fp);
if (injection->version >= INJ_VERSION_4) {
File_Read(&door_index, sizeof(int16_t), 1, fp);
}

if (base_room < 0 || base_room >= g_RoomCount) {
File_Skip(fp, sizeof(int16_t) * 12);
Expand All @@ -1619,7 +1623,8 @@ static void Inject_RoomDoorEdits(INJECTION *injection)
DOOR_INFO *door = NULL;
for (int j = 0; j < r->doors->count; j++) {
DOOR_INFO d = r->doors->door[j];
if (d.room_num == link_room) {
if (d.room_num == link_room
&& (j == door_index || door_index == -1)) {
door = &r->doors->door[j];
break;
}
Expand All @@ -1628,7 +1633,8 @@ static void Inject_RoomDoorEdits(INJECTION *injection)
if (!door) {
File_Skip(fp, sizeof(int16_t) * 12);
LOG_WARNING(
"Room index %d has no door to %d", base_room, link_room);
"Room index %d has no matching door to %d", base_room,
link_room);
continue;
}

Expand Down

0 comments on commit a914c53

Please sign in to comment.