summaryrefslogtreecommitdiff
path: root/src/net/eathena/guildrecv.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-09-25 21:29:33 +0300
committerAndrei Karas <akaras@inbox.ru>2018-09-25 21:29:33 +0300
commitdf0761d02f541723a4d127ef1d252cfa66e6a852 (patch)
treea2bb25eeccb1755bc3757026d98953069da7b1c7 /src/net/eathena/guildrecv.cpp
parent600bd9adc18e2c8b5f62e998779c1e1650272cc0 (diff)
downloadmanaplus-df0761d02f541723a4d127ef1d252cfa66e6a852.tar.gz
manaplus-df0761d02f541723a4d127ef1d252cfa66e6a852.tar.bz2
manaplus-df0761d02f541723a4d127ef1d252cfa66e6a852.tar.xz
manaplus-df0761d02f541723a4d127ef1d252cfa66e6a852.zip
Add packet SMSG_GUILD_LEAVE2 0x0a83.
Diffstat (limited to 'src/net/eathena/guildrecv.cpp')
-rw-r--r--src/net/eathena/guildrecv.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/net/eathena/guildrecv.cpp b/src/net/eathena/guildrecv.cpp
index 48546b6cf..5fa99bb78 100644
--- a/src/net/eathena/guildrecv.cpp
+++ b/src/net/eathena/guildrecv.cpp
@@ -505,6 +505,57 @@ void GuildRecv::processGuildLeave(Net::MessageIn &msg)
}
}
+void GuildRecv::processGuildLeave2(Net::MessageIn &msg)
+{
+ const int charId = msg.readInt32("char id");
+ msg.readString(40, "message");
+ std::string nick;
+
+ if (taGuild != nullptr)
+ {
+ const GuildMember *const member = taGuild->getMemberByCharId(charId);
+ if (member != nullptr)
+ {
+ nick = member->getName();
+ taGuild->removeMember(member);
+ }
+ }
+
+ if (localPlayer == nullptr)
+ return;
+
+ if (charId == PlayerInfo::getCharId())
+ {
+ if (taGuild != nullptr)
+ {
+ taGuild->removeFromMembers();
+ taGuild->clearMembers();
+ localPlayer->removeGuild(taGuild->getId());
+ }
+ NotifyManager::notify(NotifyTypes::GUILD_LEFT);
+ delete2(guildTab)
+
+ if ((socialWindow != nullptr) && (taGuild != nullptr))
+ socialWindow->removeTab(taGuild);
+ if (actorManager != nullptr)
+ actorManager->updatePlayerColors();
+ }
+ else
+ {
+ NotifyManager::notify(NotifyTypes::GUILD_USER_LEFT, nick);
+ if (actorManager != nullptr)
+ {
+ Being *const b = actorManager->findBeingByName(
+ nick, ActorType::Player);
+
+ if (b != nullptr)
+ b->clearGuilds();
+ if (taGuild != nullptr)
+ taGuild->removeMember(nick);
+ }
+ }
+}
+
void GuildRecv::processGuildMessage(Net::MessageIn &msg)
{
const int msgLength = msg.readInt16("len") - 4;