From bcc254e0ba1c860e0b4d67c8d0eaf0ba494d2bdd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 23 Jan 2020 19:14:10 +0100 Subject: [PATCH] - enabled '+' command line args to execute CCMDs on startup. --- source/common/gamecontrol.cpp | 4 ++++ source/common/music/music.cpp | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/common/gamecontrol.cpp b/source/common/gamecontrol.cpp index d3c60453c..dcdca6d13 100644 --- a/source/common/gamecontrol.cpp +++ b/source/common/gamecontrol.cpp @@ -681,6 +681,10 @@ int RunGame() } mouseGrabInput(true); // the intros require the mouse to be grabbed. + + auto exec = C_ParseCmdLineParams(nullptr); + if (exec) exec->ExecCommands(); + return gi->app_main(); } diff --git a/source/common/music/music.cpp b/source/common/music/music.cpp index bcacb8cba..e9379b592 100644 --- a/source/common/music/music.cpp +++ b/source/common/music/music.cpp @@ -320,10 +320,10 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force) { // Always look in the 'music' subfolder as well. FStringf aliasMusicname("music/%s", musicname); - if ((lumpnum = fileSystem.FindFile(musicname)) == -1 && (g_gameType & GAMEFLAG_SW)) + if ((lumpnum = fileSystem.FindFile(aliasMusicname)) == -1 && (g_gameType & GAMEFLAG_SW)) { // Some Shadow Warrioe distributions have the music in a subfolder named 'classic'. Check that, too. - FStringf aliasMusicname("classic/music/%s", musicname); + aliasMusicname.Format("classic/music/%s", musicname); lumpnum = fileSystem.FindFile(aliasMusicname); } } @@ -339,7 +339,7 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force) { Printf(TEXTCOLOR_RED "Unable to play music " TEXTCOLOR_WHITE "\"%s\"\n", musicname); } - else if (printmusicinfo) Printf("Playing music from file system %s:%s\n", fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(lumpnum)), musicname); + else if (printmusicinfo) Printf("Playing music from file system %s:%s\n", fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(lumpnum)), fileSystem.GetFileFullPath(lumpnum)); } else if (printmusicinfo) Printf("Playing music from external file %s\n", musicname);