Skip to content

Commit e400ac6

Browse files
author
AnotherCommander
committed
Fixed bug where a savefile passed as cmd line argument would not load unless it was the last argument.
1 parent 82f9ce6 commit e400ac6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/SDL/main.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,10 @@ int main(int argc, char *argv[])
155155
{
156156
i++;
157157
}
158-
if (i < argc)
158+
NSString *argument = [NSString stringWithCString:argv[i]];
159+
if (i < argc && [[argument lowercaseString] hasSuffix:@".oolite-save"])
159160
{
160-
[controller setPlayerFileToLoad: [NSString stringWithCString: argv[i]]];
161+
[controller setPlayerFileToLoad:argument];
161162
}
162163
else continue;
163164

0 commit comments

Comments
 (0)