diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-04 20:05:48 +0300 |
commit | 62ec17f6e489ec50f17219444468aeb8969dc961 (patch) | |
tree | 350d7edb5c26c282a4e1906544536d68831228ac /src/guild.cpp | |
parent | 71d924d7dcdac067f02a317e9353ee067dbd0bde (diff) | |
parent | fd484fc70fca32ff9065b91c175089b65aa3fd26 (diff) | |
download | plus-stripped1.1.9.4.tar.gz plus-stripped1.1.9.4.tar.bz2 plus-stripped1.1.9.4.tar.xz plus-stripped1.1.9.4.zip |
Merge branch 'master' into strippedstripped1.1.9.4
Conflicts:
data/fonts/mplus-1p-bold.ttf
data/fonts/mplus-1p-regular.ttf
src/guichan/basiccontainer.cpp
src/guichan/include/guichan/basiccontainer.hpp
src/guichan/widgets/window.cpp
Diffstat (limited to 'src/guild.cpp')
-rw-r--r-- | src/guild.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/guild.cpp b/src/guild.cpp index b84602858..98e5bb519 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -24,6 +24,8 @@ #include "actorspritemanager.h" +#include "utils/stringutils.h" + #include "debug.h" class SortGuildFunctor @@ -33,10 +35,22 @@ class SortGuildFunctor { if (!m1 || !m2) return false; + + if (m1->getOnline() != m2->getOnline()) + return m1->getOnline() > m2->getOnline(); + if (m1->getPos() != m2->getPos()) - return m1->getPos() < m2->getPos(); + return m1->getPos() > m2->getPos(); - return m1->getName() < m2->getName(); + if (m1->getName() != m2->getName()) + { + std::string s1 = m1->getName(); + std::string s2 = m2->getName(); + toLower(s1); + toLower(s2); + return s1 < s2; + } + return false; } } guildSorter; @@ -66,7 +80,8 @@ Guild::GuildMap Guild::guilds; Guild::Guild(short id): mId(id), mCanInviteUsers(false), - mEmblemId(0) + mEmblemId(0), + mServerGuild(true) { guilds[id] = this; } |