diff --git a/src/debug/harness.cpp b/src/debug/harness.cpp index 87c2d31..9794622 100644 --- a/src/debug/harness.cpp +++ b/src/debug/harness.cpp @@ -2036,7 +2036,24 @@ int RunDescend(const RoomLibrary& rooms, const EntityCatalog& catalog, uint32_t return n; }(); - game.PlaceSquad(game.targets[size_t(victim)].pos + Vec2{3.0f, 0.0f}, true); + // Ставим отряд в СВОБОДНУЮ клетку рядом с тварью и с прямой + // видимостью. Слепое «+3 по X» попадало в стену, стоило + // комнатам измениться: боец не видел цель, клинок её не брал, и + // проверка объявляла непроходимым первый этаж — хотя мерила + // собственную раскладку. + const Vec2 foePos = game.targets[size_t(victim)].pos; + Vec2 spot = foePos + Vec2{3.0f, 0.0f}; + const Vec2 around[8] = {{3, 0}, {-3, 0}, {0, 3}, {0, -3}, + {2, 2}, {-2, 2}, {2, -2}, {-2, -2}}; + for (const Vec2& d : around) + { + const Vec2 test = foePos + d; + if (game.map.IsWallAt(test)) continue; + if (game.map.RaycastBlocked(test, foePos)) continue; + spot = test; + break; + } + game.PlaceSquad(spot, true); game.Step(FIXED_DT); // SyncLoadout: здоровье по надетому game.squad.agents[0].hp = game.squad.agents[0].maxHp; hpStart = game.squad.agents[0].hp;