diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-06 00:28:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-06 01:56:21 +0300 |
commit | 3acb4aa3b1248719a3896b419600864a68c65908 (patch) | |
tree | 33c77fb54bdb45140252064d11fcd5f7664e2adf /src/actormanager.cpp | |
parent | 97868ad421f8587ffedda5392ac0af2c3fecc7bb (diff) | |
download | manaverse-3acb4aa3b1248719a3896b419600864a68c65908.tar.gz manaverse-3acb4aa3b1248719a3896b419600864a68c65908.tar.bz2 manaverse-3acb4aa3b1248719a3896b419600864a68c65908.tar.xz manaverse-3acb4aa3b1248719a3896b419600864a68c65908.zip |
eathena: impliment packet SMSG_CHAT_ROOM_DESTROY.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r-- | src/actormanager.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index d4748fce2..954fe087f 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -53,6 +53,7 @@ #include "net/playerhandler.h" #include "net/serverfeatures.h" +#include "resources/chatobject.h" #include "resources/iteminfo.h" #include "resources/db/itemdb.h" @@ -1807,10 +1808,27 @@ Being *ActorManager::cloneBeing(const Being *const srcBeing, dstBeing->setSprite(slot, spriteId, "", color, false); } const int hairSlot = charServerHandler->hairSprite(); - const int hairStyle = -srcBeing->getSpriteID(hairSlot); + const int hairStyle = -srcBeing->getSpriteID(hairSlot); const unsigned char hairColor = srcBeing->getHairColor(); dstBeing->setSprite(hairSlot, hairStyle * -1, ItemDB::get(-hairStyle).getDyeColorsString(hairColor)); dstBeing->setHairColor(hairColor); return dstBeing; } + +void ActorManager::removeRoom(const int chatId) +{ + for_actors + { + ActorSprite *const actor = *it; + if (actor && actor->getType() != ActorType::Player) + { + Being *const being = static_cast<Being*>(actor); + const ChatObject *const chat = being->getChat(); + if (chat && chat->chatId == chatId) + { + being->setChat(nullptr); + } + } + } +} |