summaryrefslogtreecommitdiff
path: root/src/chat-server/guild.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-11-27 15:50:33 +0000
committerDavid Athay <ko2fan@gmail.com>2008-11-27 15:50:33 +0000
commitc0e627c2c7de615d51e4907258830e31311f7e06 (patch)
treeab7a55bd20348b8ce882737c5a0e0891d931d092 /src/chat-server/guild.cpp
parent770c9079087e76712e7b8cc455b92c64f2aab3e3 (diff)
downloadmanaserv-c0e627c2c7de615d51e4907258830e31311f7e06.tar.gz
manaserv-c0e627c2c7de615d51e4907258830e31311f7e06.tar.bz2
manaserv-c0e627c2c7de615d51e4907258830e31311f7e06.tar.xz
manaserv-c0e627c2c7de615d51e4907258830e31311f7e06.zip
Fixed bug found by b_lindeijer
Diffstat (limited to 'src/chat-server/guild.cpp')
-rw-r--r--src/chat-server/guild.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/chat-server/guild.cpp b/src/chat-server/guild.cpp
index ca2dd792..46fa6cb9 100644
--- a/src/chat-server/guild.cpp
+++ b/src/chat-server/guild.cpp
@@ -53,8 +53,9 @@ void Guild::removeMember(int playerId)
{
// if the leader is leaving, assign next member as leader
std::list<GuildMember*>::iterator itr = mMembers.begin();
- itr++;
- setLeader((*itr)->mId);
+ ++itr;
+ if (itr != mMembers.end())
+ setLeader((*itr)->mId);
}
GuildMember *member = getMember(playerId);
if (member)