feat(editor): mou la porta i persisteix geometry.door_col

This commit is contained in:
JailDesigner committed 2026-05-02 13:35:01 +02:00
1 parent a254fdd669
commit c003e6665e
8 files changed
+214 -20

No files matched your search

+6
View File
@@ -528,6 +528,12 @@ void GameScene::loadRoom(const std::string& yaml_path) {
tilemap_ = Tilemap(yaml_path);
paint_layer_ = std::make_unique<PaintLayer>(tilemap_, &entity_manager_.getBus());
entity_manager_.reload(yaml_path);
// Refresquem la còpia local de Map::Info als players: la geometria
// pot haver canviat (p.ex. door_col del editor), i sense això
// `clampToPlayfield` continuaria usant el corridor antic i el
// jugador no podria sortir per la nova posició de la porta.
const auto INFO = Map::makeInfo();
for (auto& p : players_) { p->setMapInfo(INFO); }
// Tornem a fixar el comptador de "esperats" amb només els slots
// actius — un slot DISABLED permanent (single-player) no compta.
const int ACTIVE_COUNT = std::ranges::count(players_starts_active_, true);