src/variables.cxx

changeset 74
007fbadfa7f9
parent 73
1ee9b312dc18
--- a/src/variables.cxx	Sat Jan 11 22:36:31 2014 +0200
+++ b/src/variables.cxx	Mon Jan 13 00:15:38 2014 +0200
@@ -45,7 +45,7 @@
 // ============================================================================
 // Tries to declare a new global-scope variable. Returns pointer
 // to new global variable, null if declaration failed.
-script_variable* DeclareGlobalVariable (botscript_parser* r, type_e type, string name)
+script_variable* declare_global_variable (type_e type, string name)
 {
 	// Unfortunately the VM does not support string variables so yeah.
 	if (type == TYPE_STRING)
@@ -58,7 +58,7 @@
 	if (IsKeyword (name))
 		error ("name of variable-to-be `%s` is a keyword", name.chars());
 
-	if (g_GlobalVariables.size() >= MAX_SCRIPT_VARIABLES)
+	if (g_GlobalVariables.size() >= g_max_global_vars)
 		error ("too many global variables!");
 
 	for (int i = 0; i < g_GlobalVariables.size(); i++)
@@ -78,7 +78,7 @@
 
 // ============================================================================
 // Find a global variable by name
-script_variable* FindGlobalVariable (string name)
+script_variable* find_global_variable (string name)
 {
 	for (int i = 0; i < g_GlobalVariables.size(); i++)
 	{
@@ -89,11 +89,4 @@
 	}
 
 	return null;
-}
-
-// ============================================================================
-// Count all declared global variables
-int CountGlobalVars ()
-{
-	return g_GlobalVariables.size();
-}
+}
\ No newline at end of file

mercurial