Skip to content

Commit

Permalink
Leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
bruhmoent committed Jul 13, 2024
1 parent f5eea9b commit e284551
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/object/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ Player::update(float dt_sec)
if (can_swim_here)
{
m_no_water = false;

}
else
{
Expand All @@ -523,9 +524,6 @@ Player::update(float dt_sec)

if (m_bubble_timer.check())
{
int bubble_count = graphicsRandom.rand(3, 5);
float vertical_spacing = 20.0f - graphicsRandom.randf(5);

glm::vec2 beak_local_offset(30.f, 0.0f);

float sprite_angle_rad = glm::radians(m_sprite->get_angle());
Expand Down Expand Up @@ -2453,7 +2451,7 @@ Player::on_flip(float height)
{
Vector pos = get_pos();
pos.y = height - pos.y - get_bbox().get_height();
set_pos_reset(pos);
set_pos(pos);
}

void
Expand Down Expand Up @@ -2566,17 +2564,6 @@ 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 @@ -3087,7 +3074,7 @@ Player::multiplayer_respawn()
set_group(COLGROUP_MOVING);
m_physic.reset();

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

Expand Down

0 comments on commit e284551

Please sign in to comment.