Skip to content

Commit e095377

Browse files
authored
Fix growup collecting issue introduced in #2200 (#2224)
1 parent 1268d3b commit e095377

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/object/player.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Player::adjust_height(float new_height, float bottom_offset)
319319
if (new_height > m_col.m_bbox.get_height()) {
320320
//Rectf additional_space = bbox2;
321321
//additional_space.set_height(new_height - m_col.m_bbox.get_height());
322-
if (!Sector::get().is_free_of_statics(bbox2, this, true) || !Sector::get().is_free_of_movingstatics(bbox2, this))
322+
if (!Sector::get().is_free_of_statics(bbox2, this, true))
323323
return false;
324324
}
325325

@@ -995,6 +995,13 @@ Player::do_standup(bool force_standup) {
995995
if (!m_duck || !is_big() || m_backflipping || m_stone)
996996
return;
997997

998+
Rectf new_bbox = m_col.m_bbox;
999+
float new_height = m_swimming ? TUX_WIDTH : BIG_TUX_HEIGHT;
1000+
new_bbox.move(Vector(0, m_col.m_bbox.get_height() - new_height));
1001+
new_bbox.set_height(new_height);
1002+
if (!Sector::get().is_free_of_movingstatics(new_bbox, this) && !force_standup)
1003+
return;
1004+
9981005
if (m_swimming ? adjust_height(TUX_WIDTH) : adjust_height(BIG_TUX_HEIGHT)) {
9991006
m_duck = false;
10001007
m_unduck_hurt_timer.stop();

0 commit comments

Comments
 (0)