Skip to content

Commit

Permalink
Fix incorrect moving of MrIceBlock on ungrab (#3086) (#3098)
Browse files Browse the repository at this point in the history
Co-authored-by: Marty <[email protected]>
  • Loading branch information
Sylaralen and MatusGuy authored Nov 23, 2024
1 parent b195d2c commit 1a644cc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/badguy/mriceblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,14 @@ MrIceBlock::ungrab(MovingObject& object, Direction dir_)
}
if (dir_ == Direction::UP) {
m_physic.set_velocity_y(-KICKSPEED);
set_state(ICESTATE_FLAT);
if (std::abs(player->get_physic().get_velocity_x()) < 1.0f) {
set_state(ICESTATE_FLAT);
}
else
{
m_dir = (m_physic.get_velocity_x() > 0) ? Direction::RIGHT : Direction::LEFT;
set_state(ICESTATE_KICKED);
}
}
else if (dir_ == Direction::DOWN) {
Vector mov(0, 32);
Expand Down

0 comments on commit 1a644cc

Please sign in to comment.