From 9e39239ce2d8c9397f5bb347930efcfd614ef559 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 31 Oct 2010 17:53:00 +0100 Subject: skip start params when parsing argv in console --- src/engine/shared/console.cpp | 16 ++++++++++++++-- 1 file 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 -- cgit 1.4.1