From ec3cc4971027f395ff40c0d823bbe02dfd98fc2a Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 21 Nov 2025 22:07:53 +0100 Subject: [PATCH] =?UTF-8?q?si=20el=20jugador=20arriba=20al=20borde=20infer?= =?UTF-8?q?ior=20de=20la=20habitaci=C3=B3=20i=20no=20hi=20ha=20conexi?= =?UTF-8?q?=C3=B3,=20mor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/game/scenes/game.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/game/scenes/game.cpp b/source/game/scenes/game.cpp index 3e90d429..7a548c79 100644 --- a/source/game/scenes/game.cpp +++ b/source/game/scenes/game.cpp @@ -2,7 +2,7 @@ #include -#include // Para std::sqrt, std::min +#include // Para std::sqrt, std::min #include #include // Para vector @@ -557,10 +557,13 @@ auto Game::changeRoom(const std::string& room_path) -> bool { // Comprueba si el jugador esta en el borde de la pantalla void Game::checkPlayerIsOnBorder() { if (player_->isOnBorder()) { - const std::string ROOM_NAME = room_->getRoom(player_->getBorder()); + const auto BORDER = player_->getBorder(); + const auto ROOM_NAME = room_->getRoom(BORDER); if (changeRoom(ROOM_NAME)) { player_->switchBorders(); spawn_data_ = player_->getSpawnParams(); + } else if (BORDER == Room::Border::BOTTOM) { + killPlayer(); } } }