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

inject: fix Atlantean Stronghold room portals #948

Merged
merged 1 commit into from
Aug 28, 2023
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 @@ -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
Loading