Skip to content

Commit

Permalink
Allow mod dirs as command-line arguments as well
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Nov 14, 2023
1 parent cb34a1a commit 2b7637f
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions Quake/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2799,12 +2799,28 @@ static qboolean COM_PatchCmdLine (const char *fullpath)
return false;
}

UTF8_ToQuake (printpath, sizeof (printpath), relpath);

// Apply game dir
Q_strncpy (game, relpath, (int)(sep - relpath));
COM_AddArg ("-game");
COM_AddArg (game);
if (*sep)
{
Q_strncpy (game, relpath, (int)(sep - relpath));
COM_AddArg ("-game");
COM_AddArg (game);
relpath = sep + 1;
}
else if (type == FS_ENT_DIRECTORY)
{
COM_AddArg ("-game");
COM_AddArg (relpath);
return true;
}
else
{
Con_SafePrintf ("File \"%s\" not in a mod dir, ignoring.\n", printpath);
return false;
}

q_strlcpy (qpath, relpath, sizeof (qpath));
COM_NormalizePath (qpath);

Expand Down Expand Up @@ -2859,8 +2875,7 @@ static qboolean COM_PatchCmdLine (const char *fullpath)
break;
}

UTF8_ToQuake (printpath, sizeof (printpath), relpath);
Con_SafePrintf ("Unsupported file type \"%s\"\n", printpath);
Con_SafePrintf ("Unsupported file type \"%s\", ignoring.\n", printpath);

return false;
}
Expand Down

0 comments on commit 2b7637f

Please sign in to comment.