mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
Support starting maps with '-' from commandline, fix #757
like ./quake2 +map sgc9-1 the problem was that everything from '-' to the next '+' (which starts a command) was skipped; the intention of that (original Quake2) code probably was to allow skipping something like "-datadir bla", though Quake2 never supported arguments starting with '-' (until *we* added -datadir and -portable); maybe that's a leftover from Quake1. Anyway, the more correct way (that allows '-' in filenames) is to check for a space before '-': so `quake2 +map base1 -portable` still works, and now `quake2 +map sgc9-1` works as well
This commit is contained in:
parent
9a11251740
commit
568602ab49
1 changed files with 1 additions and 1 deletions
|
@ -341,7 +341,7 @@ Cbuf_AddLateCommands(void)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
for (j = i; (text[j] != '+') && (text[j] != '-') && (text[j] != 0); j++)
|
for (j = i; (text[j] != '+') && !(text[j] == '-' && text[j-1] == ' ') && (text[j] != 0); j++)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue