From aa9a175751c2a11698e6772ad9ee4eecfcc84bce Mon Sep 17 00:00:00 2001 From: "z.kirill" Date: Mon, 17 Aug 2026 05:30:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=B4=D0=B8=D0=BD=D0=BE=D1=87=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=20=D0=BE=D1=82=D1=80?= =?UTF-8?q?=D1=8F=D0=B4=20=D0=B2=20=D1=81=D1=82=D0=B5=D0=BD=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Она сажала бойца в точку «+3 по X» от твари, не глядя на карту. Стоило комнатам стать другими - точка попала в стену: боец не видел цель, клинок её не брал, и проверка объявила первый этаж непроходимым, хотя мерила собственную раскладку. Теперь ищется свободная клетка с прямой видимостью - тем же способом, что и в проверке триггеров, где эта же ошибка уже вылезала. Co-Authored-By: Claude Opus 5 --- src/debug/harness.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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;