mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
do not expect user input if stdin is redirected
If GZDoom is built on a POSIX system without the GTK frontend and not run from a KDE session, an IWAD picker is presented on the terminal and expects the user to select a game wad. However, if stdin is redirected, this won't work, so start with the default IWAD instead.
This commit is contained in:
parent
194dd3e4cf
commit
cc7807bb10
1 changed files with 5 additions and 0 deletions
|
@ -260,6 +260,11 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
|||
return I_PickIWad_Cocoa (wads, numwads, showwin, defaultiwad);
|
||||
#endif
|
||||
|
||||
if (!isatty(fileno(stdin)))
|
||||
{
|
||||
return defaultiwad;
|
||||
}
|
||||
|
||||
printf ("Please select a game wad (or 0 to exit):\n");
|
||||
for (i = 0; i < numwads; ++i)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue