From: Florian Forster Date: Sat, 30 Jan 2010 10:48:19 +0000 (+0000) Subject: Bug 541: Version-sort the level filenames. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a303529b4ea771880fb522c1e859c1c538989c95;p=supertux.git Bug 541: Version-sort the level filenames. Resolves #541. Thanks to Matt McCutchen for this patch. SVN-Revision: 6291 --- diff --git a/src/supertux/world.cpp b/src/supertux/world.cpp index 399816cec..f13609811 100644 --- a/src/supertux/world.cpp +++ b/src/supertux/world.cpp @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include + #include "lisp/parser.hpp" #include "lisp/writer.hpp" #include "physfs/ifile_stream.hpp" @@ -98,7 +100,6 @@ World::load(const std::string& filename) info->get("title", title); info->get("description", description); info->get("levelset", is_levelset); - info->get("levels", levels); info->get("hide-from-contribs", hide_from_contribs); // Level info file doesn't define any levels, so read the @@ -117,6 +118,8 @@ World::load(const std::string& filename) } } PHYSFS_freeList(files); + + std::sort(levels.begin(), levels.end(), StringUtil::numeric_less); } void