Skip to content

Commit

Permalink
Fix sliding player clipping through floor (#2838)
Browse files Browse the repository at this point in the history
* Fix slider clipping through floor

* Add a line break
  • Loading branch information
weluvgoatz authored Apr 1, 2024
1 parent aaa7374 commit 6298405
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,13 +793,8 @@ Player::update(float dt_sec)

//if you stop holding down when sliding, then it stops.
//or, stop sliding if you come to a stop and are not on a slope.
if (!m_controller->hold(Control::DOWN))
{
m_sliding = false;
m_was_crawling_before_slide = false;
m_slidejumping = false;
}
else if (m_floor_normal.y == 0.f && std::abs(m_physic.get_velocity_x()) <= 1.f)
if (!m_controller->hold(Control::DOWN) ||
(m_floor_normal.y == 0.f && std::abs(m_physic.get_velocity_x()) <= 1.f))
{
if (is_big())
{
Expand Down

0 comments on commit 6298405

Please sign in to comment.