commands.cxx

changeset 8
c8bfa7e6ae1b
parent 7
118d3d5db64f
child 10
2c0f76090372
--- a/commands.cxx	Sat Jul 14 02:16:48 2012 +0300
+++ b/commands.cxx	Sat Jul 14 04:03:25 2012 +0300
@@ -48,7 +48,6 @@
 
 CommandDef* g_CommDef;
 
-#define MAX
 void ReadCommands () {
 	ScriptReader* r = new ScriptReader ((char*)"commands.def");
 	g_CommDef = NULL;
@@ -141,4 +140,17 @@
 	
 	delete r;
 	printf ("%d command definitions read.\n", numCommDefs);
+}
+
+CommandDef* GetCommandByName (str a) {
+	a.tolower ();
+	CommandDef* c;
+	ITERATE_COMMANDS (c) {
+		str b = c->name;
+		b.tolower ();
+		if (!a.compare (b))
+			return c;
+	}
+	
+	return NULL;
 }
\ No newline at end of file

mercurial