diff --git a/data/tr2/ship/data/injections/catacombs_fd.bin b/data/tr2/ship/data/injections/catacombs_fd.bin index 720362f761..7abe077047 100644 Binary files a/data/tr2/ship/data/injections/catacombs_fd.bin and b/data/tr2/ship/data/injections/catacombs_fd.bin differ diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index d4eac3f418..b904996fb2 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -16,6 +16,7 @@ - fixed one of the collapsible tiles in Opera House room 184 not triggering (#1902) - fixed being unable to use the drawbridge key in Tibetan Foothills after the flipmap (#1744) - fixed missing triggers and ladder in Catacombs of the Talion after the flipmap (#1960) +- fixed incorrect music trigger types at the beginning of Catacombs of the Talion (#1962) - fixed missing death tiles in Temple of Xian room 91 (#1920) - fixed broken final stats screen in software rendering mode (#1915, regression from 0.6) - fixed screenshots not capturing level stats (#1925, regression from 0.6) diff --git a/docs/tr2/README.md b/docs/tr2/README.md index e18fed8d76..7f1afe4abf 100644 --- a/docs/tr2/README.md +++ b/docs/tr2/README.md @@ -44,7 +44,7 @@ decompilation process. We recognize that there is much work to be done. - **Opera House**: fixed the trigger under item 203 to trigger it rather than item 204 - **Wreck of the Maria Doria**: fixed room 98 not having water - **Tibetan Foothills**: added missing triggers for the drawbridge in room 96 (after the flipmap) - - **Catacombs of the Talion**: added missing triggers and ladder in room 116 (after the flipmap) + - **Catacombs of the Talion**: changed some music trigger to pads near the first yeti, and added missing triggers and ladder in room 116 (after the flipmap) - **Ice Palace**: fixed door 143's position to resolve the invisible wall in front of it, and added an extra pickup trigger beside the Gong Hammer in room 29 - **Temple of Xian**: fixed missing death tiles in room 91 - **Floating Islands**: fixed door 72's position to resolve the invisible wall in front of it diff --git a/src/tr2/game/inject.c b/src/tr2/game/inject.c index 2ba305462e..3c8055f8c9 100644 --- a/src/tr2/game/inject.c +++ b/src/tr2/game/inject.c @@ -31,6 +31,7 @@ typedef enum { FET_ROOM_SHIFT = 3, FET_TRIGGER_ITEM = 4, FET_ROOM_PROPERTIES = 5, + FET_TRIGGER_TYPE = 6, } FLOOR_EDIT_TYPE; typedef struct { @@ -47,6 +48,8 @@ static int32_t m_DataCounts[IDT_NUMBER_OF] = { 0 }; static void M_LoadFromFile(INJECTION *injection, const char *filename); static void M_FloorDataEdits(const INJECTION *injection, int32_t data_count); +static void M_TriggerTypeChange( + const INJECTION *injection, const SECTOR *sector); static void M_TriggerParameterChange( const INJECTION *injection, const SECTOR *sector); static void M_SetMusicOneShot(const SECTOR *sector); @@ -151,6 +154,9 @@ static void M_FloorDataEdits( for (int32_t j = 0; j < fd_edit_count; j++) { const FLOOR_EDIT_TYPE edit_type = VFile_ReadS32(fp); switch (edit_type) { + case FET_TRIGGER_TYPE: + M_TriggerTypeChange(injection, sector); + break; case FET_TRIGGER_PARAM: M_TriggerParameterChange(injection, sector); break; @@ -179,6 +185,18 @@ static void M_FloorDataEdits( Benchmark_End(benchmark, NULL); } +static void M_TriggerTypeChange( + const INJECTION *const injection, const SECTOR *const sector) +{ + const uint8_t new_type = VFile_ReadU8(injection->fp); + + if (sector == NULL || sector->trigger == NULL) { + return; + } + + sector->trigger->type = new_type; +} + static void M_TriggerParameterChange( const INJECTION *const injection, const SECTOR *const sector) {