about summary refs log tree commit diff
path: root/src/engine/shared
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-08-11 00:31:42 +0200
committeroy <Tom_Adams@web.de>2010-08-11 00:31:42 +0200
commit1cde96ef79a8418a9c34f355ec49d08f1e654213 (patch)
treefc7c6298535241e78cdc60acff059711e2017f73 /src/engine/shared
parentd37c83962da7e0660d31b70a25587fd8a8ef63f2 (diff)
downloadzcatch-1cde96ef79a8418a9c34f355ec49d08f1e654213.tar.gz
zcatch-1cde96ef79a8418a9c34f355ec49d08f1e654213.zip
restore empty strings in the config to their defaults on startup
Diffstat (limited to 'src/engine/shared')
-rw-r--r--src/engine/shared/config.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/engine/shared/config.cpp b/src/engine/shared/config.cpp
index ca12e8b7..4ff02689 100644
--- a/src/engine/shared/config.cpp
+++ b/src/engine/shared/config.cpp
@@ -58,6 +58,17 @@ public:
 		#undef MACRO_CONFIG_INT 
 		#undef MACRO_CONFIG_STR 		
 	}
+
+	virtual void RestoreStrings()
+	{
+		#define MACRO_CONFIG_INT(Name,ScriptName,def,min,max,flags,desc)	// nop
+		#define MACRO_CONFIG_STR(Name,ScriptName,len,def,flags,desc) if(!g_Config.m_##Name[0] && def[0]) str_copy(g_Config.m_##Name, def, len);
+
+		#include "config_variables.h"
+
+		#undef MACRO_CONFIG_INT
+		#undef MACRO_CONFIG_STR
+	}
 	
 	virtual void Save()
 	{