From e284551f6c78dd4760c3537bd18aaa8b0adeb487 Mon Sep 17 00:00:00 2001 From: bruhmoent Date: Sat, 13 Jul 2024 11:52:05 +0200 Subject: [PATCH] Leftovers --- src/object/player.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 4823038f3ff..9554a6b2898 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -512,6 +512,7 @@ Player::update(float dt_sec) if (can_swim_here) { m_no_water = false; + } else { @@ -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()); @@ -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 @@ -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); @@ -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(); }