From bff993b72b7b50f74e32c7aa5ce456faff680b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= Date: Fri, 18 Aug 2023 02:22:32 +0200 Subject: [PATCH] only disable gravity in rcrystallo's additional constructor if it's not set to fall immediately --- src/badguy/rcrystallo.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/badguy/rcrystallo.cpp b/src/badguy/rcrystallo.cpp index c9f58637a45..bbc525f3afb 100644 --- a/src/badguy/rcrystallo.cpp +++ b/src/badguy/rcrystallo.cpp @@ -42,9 +42,16 @@ RCrystallo::RCrystallo(const Vector& pos, const Vector& start_pos, float vel_x, m_state(RCRYSTALLO_ROOF), m_radius(radius) { - if (fall) m_state = RCRYSTALLO_DETECT; + if (fall) + { + m_state = RCRYSTALLO_DETECT; + m_physic.set_gravity_modifier(0.f); + } + else + { + m_physic.set_gravity_modifier(-1.f); + } m_physic.set_velocity_x(vel_x); - m_physic.set_gravity_modifier(0.f); m_sprite = std::move(sprite); m_dead_script = script; m_start_position = start_pos;