From d0d5cb0e662be4f58e3e63d3603ff3d30c002f42 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 8 May 2026 13:40:30 +0200 Subject: [PATCH] =?UTF-8?q?fix(player):=20players=5Fcollide=20tamb=C3=A9?= =?UTF-8?q?=20anul=C2=B7la=20resolver=20i=20landing=20overlap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/game/entities/player.cpp | 6 ++++++ source/game/scenes/game_scene.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/source/game/entities/player.cpp b/source/game/entities/player.cpp index 4f47b04..746eae6 100644 --- a/source/game/entities/player.cpp +++ b/source/game/entities/player.cpp @@ -1032,6 +1032,12 @@ void Player::resolveLandingOverlap() { // canvi, qualsevol jugador amb el qual solape entra en HURT i // surt projectat. Així el solapament inicial es resol per moviment // del solapat, no per desplaçament forçat al lloc. + // + // Tweak `players.collide_with_each_other`: si està desactivat, el + // saltador travessa l'altre net en lloc de projectar-lo. Aquest + // camí és independent de `collidesWithWorld`, així que cal aturar-lo + // explícitament aquí. + if (!GameplayConfig::get().playersCollide()) { return; } if (all_players_ == nullptr) { return; } for (Player* other : *all_players_) { if (other == nullptr || other == this) { continue; } diff --git a/source/game/scenes/game_scene.cpp b/source/game/scenes/game_scene.cpp index e96b37b..d3981b9 100644 --- a/source/game/scenes/game_scene.cpp +++ b/source/game/scenes/game_scene.cpp @@ -32,6 +32,7 @@ #include "game/entities/entity_loader.hpp" #include "game/entities/event_bus.hpp" #include "game/entities/player.hpp" +#include "game/gameplay_config.hpp" #include "game/levels/level_manager.hpp" #include "game/map/map.hpp" #include "game/options.hpp" @@ -108,6 +109,11 @@ namespace { auto* a = ps[0]; auto* b = ps[1]; if (a == nullptr || b == nullptr) { return; } + // Tweak `players.collide_with_each_other`: amb el flag desactivat + // saltem TOT el resolver — head-on, push i bounce aeri queden + // anul·lats. La col·lisió contra el món continua intacta perquè + // viu a `Player::collidesWithWorld`/`tryMove`, no aquí. + if (!GameplayConfig::get().playersCollide()) { return; } const bool A_AIR = a->isAirborne(); const bool B_AIR = b->isAirborne();