From 12ace898907c5acf6cd8ca2179c52dccbb1dde29 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 10 Apr 2026 12:44:02 +0200 Subject: [PATCH] fix: ja no salta per pasillos estrets. early return antes d'startJump --- source/game/entities/player.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index a01b719..3add04c 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -194,6 +194,13 @@ void Player::handleJumpAndDrop() { if (state_ == State::ON_AIR) { return; } if (wanna_jump_) { + // No saltar si hay techo justo encima (pasillo de altura justa). + // Sin esta comprobación se reproducían sonido de salto + landing y un frame + // de salto antes de colisionar inmediatamente con el techo. + const auto& tc = room_->getTileCollider(); + if (tc.checkCeiling(x_, y_ - 1, WIDTH) != Collision::NONE) { + return; + } startJump(); return; }