Skip to content
Permalink
Browse files

fix game starting in singleplayer as -psn_0_ user if launched from a …

…bundle on OSX
  • Loading branch information...
UnknownShadow200 committed Sep 10, 2019
1 parent eb11dde commit 0a2af2162fb02c42e087ce2370acb3cfdb5e39ec
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/Platform.c
@@ -1570,11 +1570,19 @@ void Platform_Free(void) { }
#ifndef CC_BUILD_ANDROID
int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, String* args) {
int i, count;
argc--; /* skip executable path argument */
argc--; argv++; /* skip executable path argument */

#ifdef CC_BUILD_OSX
if (argc) {
String arg0 = String_FromReadonly(argv[0]);
String psn = String_FromConst("-psn_0_");
if (String_CaselessStarts(&arg0, &psn)) { argc--; argv++; }
}
#endif
count = min(argc, GAME_MAX_CMDARGS);

for (i = 0; i < count; i++) {
args[i] = String_FromReadonly(argv[i + 1]);
args[i] = String_FromReadonly(argv[i]);
}
return count;
}

0 comments on commit 0a2af21

Please sign in to comment.
You can’t perform that action at this time.