Skip to content

Commit e22f836

Browse files
committed
Fix concatenation of timed GUI commands
In idWindow::AddCommand() if a command already exists, it will add " ; " and then the additional command. This works. idWindow::Time() also does a concatenation for commands on gui->GetPendingCmd(), but so far did did not add anything in between the commands. If that actually happened, an invalid command string would be used later. To fix this I also add " ; " between the commands now. Also did some little tweaks to only do this if actually adding a command This bug became obvious in the Hexen: Edge Of Chaos ("eoc") mod, when returning to the main menu sometimes you'd get "WARNING: Couldn't load sound 'hexen_mainmenuplay.wav' using default" because the commands "music hexen_mainmenu" and "play hexen_fire_menu" got concatenated.
1 parent 0bafb95 commit e22f836

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

neo/ui/Window.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,13 @@ void idWindow::Time() {
11141114
}
11151115
}
11161116
}
1117-
if ( gui->Active() ) {
1118-
gui->GetPendingCmd() += cmd;
1117+
if ( gui->Active() && cmd.Length() > 0 ) {
1118+
// DG: can't just append the command, must separate commands with " ; "
1119+
idStr& pend = gui->GetPendingCmd();
1120+
if ( pend.Length() > 0 ) {
1121+
pend += " ; ";
1122+
}
1123+
pend += cmd;
11191124
}
11201125
}
11211126

0 commit comments

Comments
 (0)