From: florianf 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=c731c59b3820357436678eac2753bda5a663d9a4;p=supertux.git Bug 541: Version-sort the level filenames. Resolves #541. Thanks to Matt McCutchen for this patch. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6291 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- 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