From adefc1adb8e509389064244ebcc5a64bd1d0a53f Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 9 Feb 2025 17:26:02 +0200 Subject: [PATCH] cancel pathfinding if non-sub tries to dive --- vehicle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vehicle.cpp b/vehicle.cpp index 66b37b1..2d1bfcb 100644 --- a/vehicle.cpp +++ b/vehicle.cpp @@ -261,6 +261,8 @@ namespace battleship{ int dest = map->getCellId(destPos); + if(type != UnitType::UNDERWATER && fabs(destPos.y - cells[dest].pos.y) > .1) return; + vector heuristics; for(Map::Cell &cell : cells)