Skip to content

Commit a431825

Browse files
author
Semphris
committed
Allow skipping death sequence with escape again
1 parent 8f3d9fb commit a431825

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/supertux/game_session.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,12 @@ void
211211
GameSession::on_escape_press(bool force_quick_respawn)
212212
{
213213
auto players = m_currentsector->get_players();
214-
if ((players.size() == 1 && players[0]->is_dying() && (m_play_time > 2.0f
215-
|| force_quick_respawn))
216-
|| m_end_sequence)
214+
215+
int alive = m_currentsector->get_object_count<Player>([](const Player& p) {
216+
return !p.is_dead() && !p.is_dying();
217+
});
218+
219+
if ((!alive && (m_play_time > 2.0f || force_quick_respawn)) || m_end_sequence)
217220
{
218221
// Let the timers run out, we fast-forward them to force past a sequence
219222
if (m_end_sequence)

0 commit comments

Comments
 (0)