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; }