diff -r db677d321cf4 -r 2c368cf5cc19 src/demo.cpp --- a/src/demo.cpp Fri Jun 05 19:13:44 2015 +0300 +++ b/src/demo.cpp Sat Jun 06 22:03:00 2015 +0300 @@ -76,9 +76,14 @@ static ZandronumVersion findVersion (QString versionName) { - for (const QVariant& it : getVersions()) + QList versions = Config::get ("versions").toList(); + + for (int i = 0; i < versions.size(); ++i) { - ZandronumVersion version = it.value(); + if (not versions[i].canConvert()) + continue; + + ZandronumVersion version = versions[i].value(); if (version.name == versionName or version.name + "M" == versionName @@ -87,7 +92,7 @@ return version; } } - + return ZandronumVersion(); } @@ -103,9 +108,9 @@ { error (tr ("No WAD paths configured!")); - // Cannot just return an empty string here since that'd trigger - // another error prompt - skip ahead and exit. - exit (9); + // Cannot just return an empty string here since that'd trigger another error prompt - skip + // ahead and exit. + exit (1); } for (int i = 0; i < wadpaths.size(); ++i) @@ -204,8 +209,8 @@ } } - stream >> headers.length - >> length; + stream >> headers.length; + stream >> length; // The remaining headers are variable and relative to the length header. headers.version = headers.length + 1;