diff --git a/docs/tr2/CHANGELOG.md b/docs/tr2/CHANGELOG.md index 950448c6f..7a4bc8051 100644 --- a/docs/tr2/CHANGELOG.md +++ b/docs/tr2/CHANGELOG.md @@ -1,5 +1,6 @@ ## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-0.8...develop) - ××××-××-×× - added Linux builds and toolchain (#1598) +- fixed Lara activating triggers one frame too early (#2205, regression from 0.7) ## [0.8](https://github.com/LostArtefacts/TRX/compare/tr2-0.8...tr2-0.8) - 2025-01-01 - completed decompilation efforts – TR2X.dll is gone, Tomb2.exe no longer needed (#1694) diff --git a/src/libtrx/include/libtrx/game/collision.h b/src/libtrx/include/libtrx/game/collision.h index 3ac7cf7c2..2f0d7dd28 100644 --- a/src/libtrx/include/libtrx/game/collision.h +++ b/src/libtrx/include/libtrx/game/collision.h @@ -63,7 +63,6 @@ typedef struct __PACKING { int16_t facing; int16_t quadrant; int16_t coll_type; - int16_t *trigger; // TODO: linked to g_TriggerIndex, so to be eliminated int8_t x_tilt; int8_t z_tilt; int8_t hit_by_baddie; diff --git a/src/tr2/game/lara/control.c b/src/tr2/game/lara/control.c index a088e2ac4..7a15ad612 100644 --- a/src/tr2/game/lara/control.c +++ b/src/tr2/game/lara/control.c @@ -201,7 +201,6 @@ void Lara_HandleAboveWater(ITEM *const item, COLL_INFO *const coll) coll->old_anim_num = item->anim_num; coll->old_frame_num = item->frame_num; coll->radius = LARA_RADIUS; - coll->trigger = NULL; coll->slopes_are_walls = 0; coll->slopes_are_pits = 0; @@ -251,6 +250,7 @@ void Lara_HandleAboveWater(ITEM *const item, COLL_INFO *const coll) } item->rot.y += g_Lara.turn_rate; + Room_TestTriggers(item); Lara_Animate(item); if (!g_Lara.extra_anim && g_Lara.water_status != LWS_CHEAT) { @@ -262,7 +262,6 @@ void Lara_HandleAboveWater(ITEM *const item, COLL_INFO *const coll) Item_UpdateRoom(item, -LARA_HEIGHT / 2); Gun_Control(); - Room_TestTriggers(item); } void Lara_HandleSurface(ITEM *const item, COLL_INFO *const coll) @@ -273,7 +272,6 @@ void Lara_HandleSurface(ITEM *const item, COLL_INFO *const coll) coll->old.y = item->pos.y; coll->old.z = item->pos.z; coll->radius = LARA_RADIUS; - coll->trigger = NULL; coll->bad_pos = NO_BAD_POS; coll->bad_neg = -STEP_L / 2; @@ -306,7 +304,9 @@ void Lara_HandleSurface(ITEM *const item, COLL_INFO *const coll) Lara_WaterCurrent(coll); } + Room_TestTriggers(item); Lara_Animate(item); + item->pos.x += (item->fall_speed * Math_Sin(g_Lara.move_angle)) >> (W2V_SHIFT + 2); item->pos.z += @@ -320,7 +320,6 @@ void Lara_HandleSurface(ITEM *const item, COLL_INFO *const coll) Item_UpdateRoom(item, 100); Gun_Control(); - Room_TestTriggers(item); } void Lara_HandleUnderwater(ITEM *const item, COLL_INFO *const coll) @@ -329,7 +328,6 @@ void Lara_HandleUnderwater(ITEM *const item, COLL_INFO *const coll) coll->old.y = item->pos.y; coll->old.z = item->pos.z; coll->radius = LARA_RADIUS_UW; - coll->trigger = NULL; coll->bad_pos = NO_BAD_POS; coll->bad_neg = -LARA_HEIGHT_UW; @@ -378,7 +376,9 @@ void Lara_HandleUnderwater(ITEM *const item, COLL_INFO *const coll) Lara_WaterCurrent(coll); } + Room_TestTriggers(item); Lara_Animate(item); + item->pos.y -= (item->fall_speed * Math_Sin(item->rot.x)) >> (W2V_SHIFT + 2); item->pos.x += @@ -409,7 +409,6 @@ void Lara_HandleUnderwater(ITEM *const item, COLL_INFO *const coll) Item_UpdateRoom(item, 0); Gun_Control(); - Room_TestTriggers(item); } void Lara_Control(const int16_t item_num)