Reliably stop at edge when running at it while holding Walk

This commit is contained in:
Sezz 2025-01-04 15:51:52 +11:00
parent 43d5bb9639
commit 5444ede2a8
2 changed files with 4 additions and 1 deletions

View file

@ -22,6 +22,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
* Added realtime shader reloading in debug mode by pressing F9 key.
* Added load, save, stopwatch and compass as a functional pick-up items with ability to add or remove them from inventory.
* Increased particle limit from 1024 to 4096.
* Added ability for the player to more reliably stop at an edge when running at it while holding Walk.
### Lua API changes
* Fixed Flow.FreezeMode.FULL drawing incorrect background.

View file

@ -328,10 +328,12 @@ void lara_col_run_forward(ItemInfo* item, CollisionInfo* coll)
player.Control.MoveAngle = item->Pose.Orientation.y;
item->Animation.IsAirborne = false;
item->Animation.Velocity.y = 0;
coll->Setup.LowerFloorBound = NO_LOWER_BOUND;
coll->Setup.LowerFloorBound = IsHeld(In::Walk) ? STEPUP_HEIGHT : NO_LOWER_BOUND;
coll->Setup.UpperFloorBound = -STEPUP_HEIGHT;
coll->Setup.LowerCeilingBound = 0;
coll->Setup.BlockFloorSlopeUp = true;
coll->Setup.BlockFloorSlopeDown = IsHeld(In::Walk);
coll->Setup.BlockDeathFloorDown = IsHeld(In::Walk);
coll->Setup.ForwardAngle = player.Control.MoveAngle;
GetCollisionInfo(coll, item);
LaraResetGravityStatus(item, coll);