From b083e872e0ea32cedd6456772cd727789980071e Mon Sep 17 00:00:00 2001 From: jeefo Date: Wed, 3 Sep 2025 21:09:35 +0300 Subject: [PATCH] graph: do not spam about empty training data on changelevel --- src/storage.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/storage.cpp b/src/storage.cpp index b01b05a..9a2873c 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -229,6 +229,9 @@ template bool BotStorage::save (const SmallArray &data, ExtenHe } const auto isGraph = !!(type.option & StorageOption::Graph); + // hide some messages with debug cvar + extern ConVar cv_debug; + // do not allow to save graph with less than 8 nodes if (isGraph && graph.length () < kMaxNodeLinks) { ctrl.msg ("Can't save graph data with less than %d nodes. Please add some more before saving.", kMaxNodeLinks); @@ -237,7 +240,9 @@ template bool BotStorage::save (const SmallArray &data, ExtenHe String filename = buildPath (storageToBotFile (type.option)); if (data.empty ()) { - logger.error ("Unable to save %s file. Empty data. (filename: '%s').", type.name, filename); + if (isGraph || cv_debug) { + logger.error ("Unable to save %s file. Empty data. (filename: '%s').", type.name, filename); + } return false; } else if (isGraph) { @@ -289,7 +294,6 @@ template bool BotStorage::save (const SmallArray &data, ExtenHe if ((type.option & StorageOption::Exten) && exten != nullptr) { file.write (exten, sizeof (ExtenHeader)); } - extern ConVar cv_debug; // notify only about graph if (isGraph || cv_debug) {