Skip to content

Commit b7fb3f2

Browse files
author
AnotherCommander
committed
Fixed bug where a savefile passed as cmd line argument would not load unless it was the last argument. Ported from master.
1 parent c70761c commit b7fb3f2

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)