feat(player): no pinta el sòl mentre està en l'aire; aterratge sí pinta
This commit is contained in:
1 parent
cd50626b88
commit
a64f33fe43
1 file changed
+7
-1
@@ -583,7 +583,13 @@ void Player::applyMovement(float delta_time) {
|
|||||||
// contra una paret. Si el tile ha canviat, publiquem `on_tile_entered`
|
// contra una paret. Si el tile ha canviat, publiquem `on_tile_entered`
|
||||||
// al bus amb l'índex de pintat d'aquest jugador; el PaintLayer filtra
|
// al bus amb l'índex de pintat d'aquest jugador; el PaintLayer filtra
|
||||||
// pintabilitat i re-publica `tile_painted` als sarcòfags.
|
// pintabilitat i re-publica `tile_painted` als sarcòfags.
|
||||||
if (bus_ != nullptr) {
|
//
|
||||||
|
// En AIRBORNE NO publiquem cap pintat — el jugador està en l'aire i
|
||||||
|
// no està trepitjant cap tile. NI tampoc actualitzem `last_tile_*`,
|
||||||
|
// perquè volem que el tile d'aterratge (que es comprova al
|
||||||
|
// LANDING_STUN) compari contra l'últim tile real (el del despegue) i
|
||||||
|
// s'emeti com a entrada nova si han canviat.
|
||||||
|
if (bus_ != nullptr && state_ == State::GROUNDED) {
|
||||||
const auto [COL, ROW] = getCurrentTile();
|
const auto [COL, ROW] = getCurrentTile();
|
||||||
if (COL != last_tile_col_ || ROW != last_tile_row_) {
|
if (COL != last_tile_col_ || ROW != last_tile_row_) {
|
||||||
last_tile_col_ = COL;
|
last_tile_col_ = COL;
|
||||||
|
|||||||
Reference in new issue
Block a user