summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-04-06 00:28:30 +0300
committerAndrei Karas <akaras@inbox.ru>2015-04-06 01:56:21 +0300
commit3acb4aa3b1248719a3896b419600864a68c65908 (patch)
tree33c77fb54bdb45140252064d11fcd5f7664e2adf /src/actormanager.cpp
parent97868ad421f8587ffedda5392ac0af2c3fecc7bb (diff)
downloadmanaplus-3acb4aa3b1248719a3896b419600864a68c65908.tar.gz
manaplus-3acb4aa3b1248719a3896b419600864a68c65908.tar.bz2
manaplus-3acb4aa3b1248719a3896b419600864a68c65908.tar.xz
manaplus-3acb4aa3b1248719a3896b419600864a68c65908.zip
eathena: impliment packet SMSG_CHAT_ROOM_DESTROY.
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp20
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);
+ }
+ }
+ }
+}