Skip to content

Commit

Permalink
tr1/lara: restore original non-standard water exit (LostArtefacts#1782)
Browse files Browse the repository at this point in the history
Water depth was not tested in OG, so allowing Lara to exit in
non-standard ways. This restores that ability while still
maintaining wading support.

Resolves LostArtefacts#1781.
  • Loading branch information
lahm86 authored Nov 1, 2024
1 parent 6c9b25a commit a0ad59f
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/tr1/game/lara/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,22 +703,20 @@ void Lara_TestWaterDepth(ITEM *const item, const COLL_INFO *const coll)
const int32_t water_depth =
Lara_GetWaterDepth(item->pos.x, item->pos.y, item->pos.z, room_num);

if (water_depth == NO_HEIGHT) {
item->pos = coll->old;
item->fall_speed = 0;
} else if (water_depth <= STEP_L * 2) {
Item_SwitchToAnim(item, LA_UNDERWATER_TO_STAND, 0);
item->current_anim_state = LS_WATER_OUT;
item->goal_anim_state = LS_STOP;
item->rot.x = 0;
item->rot.z = 0;
item->gravity = 0;
item->speed = 0;
item->fall_speed = 0;
g_Lara.water_status = LWS_WADE;
item->pos.y =
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
if (water_depth == NO_HEIGHT || water_depth > STEP_L * 2) {
return;
}

Item_SwitchToAnim(item, LA_UNDERWATER_TO_STAND, 0);
item->current_anim_state = LS_WATER_OUT;
item->goal_anim_state = LS_STOP;
item->rot.x = 0;
item->rot.z = 0;
item->gravity = 0;
item->speed = 0;
item->fall_speed = 0;
g_Lara.water_status = LWS_WADE;
item->pos.y = Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
}

bool Lara_TestWaterStepOut(ITEM *const item, const COLL_INFO *const coll)
Expand Down

0 comments on commit a0ad59f

Please sign in to comment.