From a914c53235c8ec4925cee0a8cf58bb97e021d5b0 Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:45:36 +0100 Subject: [PATCH] inject: fix Atlantean Stronghold room portals (#948) 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. --- CHANGELOG.md | 1 + README.md | 1 + bin/data/stronghold_fd.bin | Bin 1006 -> 1312 bytes src/game/inject.c | 10 ++++++++-- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fd6bdac..0a203c58a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index ca0e6cbe7..84991fce3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/data/stronghold_fd.bin b/bin/data/stronghold_fd.bin index 662a188b00f9f9590dd5083ab38de9eef3bc8cd0..6c456e69aacdf399c6c1fd380d17ed1e0f1b937b 100644 GIT binary patch literal 1312 zcmWGB^z~w4U|;}YY5`6pgLr^!W+eV7b2J1-atN?62r{rSFam=Bgh4!Z6dnf(j}y-0 zW#C0p3F0AC3IbIjOc7yVWnhBqlLY2I7C4UyXr~uA_}xHEpc4=x?ieB-7$Tk+A^{j8 zffyn|7$U(KBKt5z_G5?~zz{hI74c%=0s9d`ppzh3kV15EhzLj)Tta~&1Vaq~wk-^T delta 17 ZcmZ3$^^Sc)!p52}OcNDkCKoW*0RThq2Lu2B diff --git a/src/game/inject.c b/src/game/inject.c index 79bfa2949..6baf1cd7d 100644 --- a/src/game/inject.c +++ b/src/game/inject.c @@ -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); @@ -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; } @@ -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; }