fix: 自动战斗在未存在 debug/map 路径时无法生成地图截图

This commit is contained in:
status102
2025-12-31 20:56:18 +08:00
parent 824e774b2b
commit aa34f54f22

View File

@@ -750,7 +750,7 @@ void asst::BattleHelper::save_map(const cv::Mat& image)
// 清理旧的 PNG 文件
static bool clean_png = true;
if (clean_png) {
if (clean_png && std::filesystem::exists(MapRelativeDir)) {
for (const auto& entry : std::filesystem::directory_iterator(MapRelativeDir)) {
if (entry.path().extension() == ".png") {
std::error_code ec;