Fix external commands which take no arguments.

Fixes #5998
This commit is contained in:
Gunnar Beutner 2014-04-11 15:47:26 +02:00
parent c693f7fa20
commit cdda8d5734
1 changed files with 9 additions and 8 deletions

View File

@ -122,7 +122,7 @@ void ExternalCommandProcessor::Execute(double time, const String& command, const
std::vector<String> realArguments;
realArguments.resize(argnum);
if (arguments.size() > 0)
if (argnum > 0) {
std::copy(arguments.begin(), arguments.begin() + argnum - 1, realArguments.begin());
String last_argument;
@ -134,6 +134,7 @@ void ExternalCommandProcessor::Execute(double time, const String& command, const
}
realArguments[argnum - 1] = last_argument;
}
OnNewExternalCommand(time, command, realArguments);