From c0e417cca7f80978d96b305330e38fce74896e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sun, 23 Jan 2022 21:15:21 +0600 Subject: [PATCH] add: option to disable autosaving fix: autosave nodes 1 more than specified in cvar. Now, if the value of cvar is 15, then every 15th node will be autosaved. --- src/graph.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graph.cpp b/src/graph.cpp index 6652c56..09a3698 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -9,7 +9,7 @@ ConVar cv_graph_fixcamp ("yb_graph_fixcamp", "1", "Specifies whether bot should not 'fix' camp directions of camp waypoints when loading old PWF format."); ConVar cv_graph_url ("yb_graph_url", product.download.chars (), "Specifies the URL from bots will be able to download graph in case of missing local one. Set to empty, if no downloads needed.", false, 0.0f, 0.0f); -ConVar cv_graph_auto_save_count ("yb_graph_auto_save_cout", "15", "Every N graph nodes placed on map, the graph will be saved automatically (without checks).", true, 5.0f, kMaxNodes); +ConVar cv_graph_auto_save_count ("yb_graph_auto_save_count", "15", "Every N graph nodes placed on map, the graph will be saved automatically (without checks).", true, 0.0f, kMaxNodes); ConVar cv_graph_draw_distance ("yb_graph_draw_distance", "400", "Maximum distance to draw graph nodes from editor viewport.", true, 64.0f, 512.0f); void BotGraph::reset () { @@ -674,7 +674,7 @@ void BotGraph::add (int type, const Vector &pos) { } // autosave nodes here and there - if (cv_graph_auto_save_count.bool_ () && ++m_autoSaveCount > cv_graph_auto_save_count.int_ ()) { + if (cv_graph_auto_save_count.bool_ () && ++m_autoSaveCount >= cv_graph_auto_save_count.int_ ()) { if (saveGraphData ()) { ctrl.msg ("Nodes has been autosaved..."); }