about summary refs log tree commit diff
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-31 17:53:00 +0100
committeroy <Tom_Adams@web.de>2010-10-31 17:53:00 +0100
commit9e39239ce2d8c9397f5bb347930efcfd614ef559 (patch)
tree456265d8daeebce551d429f0f6b0bc96c2cf379b
parenteace936869bfb4ffd53d4042d937106a1abe786f (diff)
downloadzcatch-9e39239ce2d8c9397f5bb347930efcfd614ef559.tar.gz
zcatch-9e39239ce2d8c9397f5bb347930efcfd614ef559.zip
skip start params when parsing argv in console
-rw-r--r--src/engine/shared/console.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp
index deda8be5..54042119 100644
--- a/src/engine/shared/console.cpp
+++ b/src/engine/shared/console.cpp
@@ -497,11 +497,23 @@ void CConsole::ParseArguments(int NumArgs, const char **ppArguments)
 	for(int i = 0; i < NumArgs; i++)
 	{
 		// check for scripts to execute
-		if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'f' && ppArguments[i][2] == 0 && NumArgs - i > 1)
+		if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'f' && ppArguments[i][2] == 0)
 		{
-			ExecuteFile(ppArguments[i+1]);
+			if(NumArgs - i > 1)
+				ExecuteFile(ppArguments[i+1]);
 			i++;
 		}
+		else if(!str_comp("-s", ppArguments[i]) || !str_comp("--silent", ppArguments[i]))
+		{
+			// skip silent param
+			continue;
+		}
+		else if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0)
+		{
+			// skip datadir param
+			++i;
+			continue;
+		}
 		else
 		{
 			// search arguments for overrides