From 5fd02542dd3fe643ff601e7371eff0583adafd73 Mon Sep 17 00:00:00 2001 From: alyokhin Date: Tue, 5 Dec 2023 20:14:13 +0300 Subject: [PATCH] Disable ASatr passability highlighting for editor --- .vscode/launch.json | 4 ++-- src/map/map_draw.cpp | 3 ++- src/map/map_fog.cpp | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index b85377ba21..85ab12ee09 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "type": "cppdbg", "linux": { "program": "${workspaceFolder}/build/stratagus-dbg", - "args": ["-W", "-a", "-d", "${workspaceFolder}/../data.${input:game}"], + "args": ["-W", "1600x1000" ,"-v", "640x480", "-F", "-a", "-d", "data.${input:game}", "-u", "./"], "environment": [ {"name": "OMP_WAIT_POLICY", "value": "passive"} ], @@ -22,7 +22,7 @@ "externalConsole": false, }, "stopAtEntry": false, - "cwd": "${workspaceFolder}/../${input:game}", + "cwd": "${workspaceFolder}/../../data", }, ], "inputs": [ diff --git a/src/map/map_draw.cpp b/src/map/map_draw.cpp index 4b518e4d3a..896566a1a9 100644 --- a/src/map/map_draw.cpp +++ b/src/map/map_draw.cpp @@ -45,6 +45,7 @@ #include "unittype.h" #include "ui.h" #include "video.h" +#include "editor.h" #include @@ -349,7 +350,7 @@ void CViewport::DrawMapBackgroundInViewport(const fieldHighlightChecker highligh Map.TileGraphic->DrawFrameClip(tile, dx, dy); #ifdef DEBUG // AStar passability overlay - if (CViewport::isPassabilityHighlighted()) { + if (CViewport::isPassabilityHighlighted() && Editor.Running == EditorNotRunning) { HighlightGraphicalTileInViewport(dx, dy, graphicTileOffset, sx, [](const CMapField &mf) -> bool { return mf.getFlag() & MapFieldUnpassable; }, diff --git a/src/map/map_fog.cpp b/src/map/map_fog.cpp index 9660275dda..0f13bdaff8 100644 --- a/src/map/map_fog.cpp +++ b/src/map/map_fog.cpp @@ -447,7 +447,6 @@ void CViewport::Clean() if (this->FogSurface) { CleanFog(); } - this->ShowAStarPassability = false; } void CViewport::CleanFog()