Skip to content

Commit

Permalink
Fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
bruhmoent committed Jul 13, 2024
1 parent efe487d commit 4ead43b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ Player::on_flip(float height)
{
Vector pos = get_pos();
pos.y = height - pos.y - get_bbox().get_height();
set_pos(pos);
set_pos_reset(pos);
}

void
Expand Down Expand Up @@ -2558,6 +2558,17 @@ Player::set_pos(const Vector& vector)
{
MovingObject::set_pos(vector);

// Make sure objects following Tux move directly with him
position_grabbed_object(true);
for (Key* key : m_collected_keys)
key->update_pos();
}

void
Player::set_pos_reset(const Vector& vector)
{
m_col.set_pos(vector);

// Reset size to get correct hitbox if Tux was eg. ducked before moving
if (is_big())
m_col.set_size(TUX_WIDTH, BIG_TUX_HEIGHT);
Expand Down Expand Up @@ -3068,7 +3079,7 @@ Player::multiplayer_respawn()
set_group(COLGROUP_MOVING);
m_physic.reset();

set_pos(target->get_pos());
set_pos_reset(target->get_pos());
m_target.reset();
}

Expand Down

0 comments on commit 4ead43b

Please sign in to comment.