summaryrefslogtreecommitdiff
path: root/src/guild.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-02 03:02:59 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-02 03:02:59 +0300
commitd0df36406220717545221b0ed94b9ab4ebb908b3 (patch)
tree80e033ab6b2691dadef1e3d2e98e9fa0826dde90 /src/guild.cpp
parentb96e34946aa326a9f8dfb80ce34cce9fc219405e (diff)
downloadManaVerse-d0df36406220717545221b0ed94b9ab4ebb908b3.tar.gz
ManaVerse-d0df36406220717545221b0ed94b9ab4ebb908b3.tar.bz2
ManaVerse-d0df36406220717545221b0ed94b9ab4ebb908b3.tar.xz
ManaVerse-d0df36406220717545221b0ed94b9ab4ebb908b3.zip
Some fixes after automatic code checking.
Diffstat (limited to 'src/guild.cpp')
-rw-r--r--src/guild.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/guild.cpp b/src/guild.cpp
index c7a9c0cdc..2e1b3d78c 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -148,8 +148,9 @@ void Guild::removeMember(GuildMember *member)
(*itr)->mCharId == member->mCharId &&
(*itr)->getName() == member->getName())
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
- delete *itr;
+ delete member;
return;
}
++itr;
@@ -159,16 +160,18 @@ void Guild::removeMember(GuildMember *member)
void Guild::removeMember(int id)
{
bool deleted = true;
- MemberList::iterator itr = mMembers.begin(),
- itr_end = mMembers.end();
while (deleted)
{
deleted = false;
+ MemberList::iterator itr = mMembers.begin(),
+ itr_end = mMembers.end();
while (itr != itr_end)
{
if ((*itr)->mId == id)
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
+ delete member;
deleted = true;
break;
}
@@ -180,16 +183,18 @@ void Guild::removeMember(int id)
void Guild::removeMember(const std::string &name)
{
bool deleted = true;
- MemberList::iterator itr = mMembers.begin(),
- itr_end = mMembers.end();
while (deleted)
{
deleted = false;
+ MemberList::iterator itr = mMembers.begin(),
+ itr_end = mMembers.end();
while (itr != itr_end)
{
if ((*itr)->getName() == name)
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
+ delete member;
deleted = true;
break;
}