Skip to content

Commit 3a3ab5c

Browse files
committed
Fix player hitbox bugs
Farewell short lived buttjump fly bug. Footage of the bug: https://youtu.be/9dfWzp7rYR4
1 parent 2ae37e5 commit 3a3ab5c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/object/player.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,14 @@ Player::collision_tile(uint32_t tile_attributes)
23282328
}
23292329
}
23302330

2331+
void
2332+
Player::update_hitbox()
2333+
{
2334+
// Don't use the default MovingSprite hitbox behavior
2335+
// because this class already has logic for that.
2336+
// Refer to the adjust_height method.
2337+
}
2338+
23312339
void
23322340
Player::collision_solid(const CollisionHit& hit)
23332341
{

src/object/player.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class Player final : public MovingSprite
8686
virtual void collision_solid(const CollisionHit& hit) override;
8787
virtual HitResponse collision(MovingObject& other, const CollisionHit& hit) override;
8888
virtual void collision_tile(uint32_t tile_attributes) override;
89+
virtual void update_hitbox() override;
8990
virtual void on_flip(float height) override;
9091
virtual bool is_saveable() const override { return false; }
9192
virtual bool is_singleton() const override { return false; }

0 commit comments

Comments
 (0)