Skip to content

Commit

Permalink
only disable gravity in rcrystallo's additional constructor if it's n…
Browse files Browse the repository at this point in the history
…ot set to fall immediately
  • Loading branch information
Narre committed Aug 18, 2023
1 parent 5495603 commit bff993b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/badguy/rcrystallo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit bff993b

Please sign in to comment.