Skip to content

Commit

Permalink
Allow picking up items while crawling (#3062)
Browse files Browse the repository at this point in the history
Allows picking up items (such as springs and stone blocks), while Tux
is crawling (triggered by moving while ducking).

This is to avoid Tux getting trapped by any item that can be grabbed.

Closes #2979.
  • Loading branch information
marbens-arch authored Oct 7, 2024
1 parent 5c5a444 commit 52cb2a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,7 @@ Player::position_grabbed_object(bool teleport)
bool
Player::try_grab()
{
if (m_controller->hold(Control::ACTION) && !m_grabbed_object && !m_duck && !m_released_object)
if (m_controller->hold(Control::ACTION) && !m_grabbed_object && !(m_duck ^ m_crawl) && !m_released_object)
{

Vector pos(0.0f, 0.0f);
Expand Down

0 comments on commit 52cb2a9

Please sign in to comment.