Skip to content

Commit b4846eb

Browse files
author
Semphris
committed
Re-fix #1912 with the new code
1 parent a431825 commit b4846eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/object/player.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,12 +2124,15 @@ Player::check_bounds()
21242124
if (m_col.m_bbox.get_right() > Sector::get().get_width()) {
21252125
// Lock Tux to the size of the level, so that he doesn't fall off
21262126
// the right side
2127-
set_pos(Vector(Sector::get().get_width() - m_col.m_bbox.get_width(), m_col.m_bbox.get_top()));
2127+
set_pos(Vector(Sector::get().get_width() - m_col.m_bbox.get_width(),
2128+
m_col.m_bbox.get_top()));
21282129
}
21292130

21302131
// If Tux is swimming, don't allow him to go below the sector
2131-
if (m_swimming && !m_ghost_mode && m_col.m_bbox.get_bottom() > Sector::get().get_height()) {
2132-
set_pos(Vector(m_col.m_bbox.get_left(), Sector::get().get_height() - m_col.m_bbox.get_height()));
2132+
if (m_swimming && !m_ghost_mode && !is_dying() && !is_dead()
2133+
&& m_col.m_bbox.get_bottom() > Sector::get().get_height()) {
2134+
set_pos(Vector(m_col.m_bbox.get_left(),
2135+
Sector::get().get_height() - m_col.m_bbox.get_height()));
21332136
}
21342137

21352138
/* fallen out of the level? */

0 commit comments

Comments
 (0)