fix(player): players_collide també anul·la resolver i landing overlap
This commit is contained in:
1 parent
e25ccd02fd
commit
d0d5cb0e66
2 files changed
+12
No files matched your search
@@ -1032,6 +1032,12 @@ void Player::resolveLandingOverlap() {
|
|||||||
// canvi, qualsevol jugador amb el qual solape entra en HURT i
|
// canvi, qualsevol jugador amb el qual solape entra en HURT i
|
||||||
// surt projectat. Així el solapament inicial es resol per moviment
|
// surt projectat. Així el solapament inicial es resol per moviment
|
||||||
// del solapat, no per desplaçament forçat al lloc.
|
// 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; }
|
if (all_players_ == nullptr) { return; }
|
||||||
for (Player* other : *all_players_) {
|
for (Player* other : *all_players_) {
|
||||||
if (other == nullptr || other == this) { continue; }
|
if (other == nullptr || other == this) { continue; }
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "game/entities/entity_loader.hpp"
|
#include "game/entities/entity_loader.hpp"
|
||||||
#include "game/entities/event_bus.hpp"
|
#include "game/entities/event_bus.hpp"
|
||||||
#include "game/entities/player.hpp"
|
#include "game/entities/player.hpp"
|
||||||
|
#include "game/gameplay_config.hpp"
|
||||||
#include "game/levels/level_manager.hpp"
|
#include "game/levels/level_manager.hpp"
|
||||||
#include "game/map/map.hpp"
|
#include "game/map/map.hpp"
|
||||||
#include "game/options.hpp"
|
#include "game/options.hpp"
|
||||||
@@ -108,6 +109,11 @@ namespace {
|
|||||||
auto* a = ps[0];
|
auto* a = ps[0];
|
||||||
auto* b = ps[1];
|
auto* b = ps[1];
|
||||||
if (a == nullptr || b == nullptr) { return; }
|
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 A_AIR = a->isAirborne();
|
||||||
const bool B_AIR = b->isAirborne();
|
const bool B_AIR = b->isAirborne();
|
||||||
|
|||||||
Reference in new issue
Block a user