Skip to content

Fixes Bug #3209 #3232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/object/player.cpp
Original file line number Diff line number Diff line change
@@ -2307,7 +2307,7 @@ Player::collision_tile(uint32_t tile_attributes)
}

void
Player::collision_solid(const CollisionHit& hit)
Player::handle_collision_logic(const CollisionHit& hit)
{
if (hit.bottom) {
if (m_physic.get_velocity_y() > 0)
@@ -2360,6 +2360,12 @@ Player::collision_solid(const CollisionHit& hit)
m_boost = 0.f;
}

void
Player::collision_solid(const CollisionHit& hit)
{
handle_collision_logic(hit);
}

HitResponse
Player::collision(MovingObject& other, const CollisionHit& hit)
{
@@ -2392,6 +2398,9 @@ Player::collision(MovingObject& other, const CollisionHit& hit)
return FORCE_MOVE;
if (m_stone)
return ABORT_MOVE;
if (badguy->is_frozen() && badguy->get_physic().get_velocity_y() != 0) {
handle_collision_logic(hit);
}
}

return CONTINUE;
3 changes: 3 additions & 0 deletions src/object/player.hpp
Original file line number Diff line number Diff line change
@@ -493,6 +493,9 @@ class Player final : public MovingObject
*/
void ungrab_object(GameObject* gameobject = nullptr);

/** Method for shared collision logic */
void handle_collision_logic(const CollisionHit& hit);

void next_target();
void prev_target();