summaryrefslogtreecommitdiff
path: root/src/net/ea/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-28 15:04:05 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-28 15:04:05 +0300
commit0278a66e30a3f2df0932ee501b5e5dc09b1a23ce (patch)
tree733f005cf75347666908bf5cf40e99e870cb728c /src/net/ea/beinghandler.cpp
parent5a537c0ee685a7afc332f6707fd255032eb9d77b (diff)
downloadplus-0278a66e30a3f2df0932ee501b5e5dc09b1a23ce.tar.gz
plus-0278a66e30a3f2df0932ee501b5e5dc09b1a23ce.tar.bz2
plus-0278a66e30a3f2df0932ee501b5e5dc09b1a23ce.tar.xz
plus-0278a66e30a3f2df0932ee501b5e5dc09b1a23ce.zip
Show portal names in popup if portal not present at map.
Diffstat (limited to 'src/net/ea/beinghandler.cpp')
-rw-r--r--src/net/ea/beinghandler.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index f9fdf3c38..fe42daedc 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -33,10 +33,14 @@
#include "particle/particle.h"
+#include "gui/viewport.h"
+
#include "gui/windows/botcheckerwindow.h"
#include "gui/windows/socialwindow.h"
#include "gui/windows/killstats.h"
+#include "resources/mapitemtype.h"
+
#include "resources/map/map.h"
#include "debug.h"
@@ -331,7 +335,20 @@ void BeingHandler::processNameResponse(Net::MessageIn &msg) const
}
else
{
- dstBeing->setName(msg.readString(24, "name"));
+ const std::string name = msg.readString(24, "name");
+ if (dstBeing->getType() != ActorType::Portal)
+ {
+ dstBeing->setName(name);
+ }
+ else if (viewport)
+ {
+ Map *const map = viewport->getMap();
+ if (map)
+ {
+ map->addPortalTile(name, MapItemType::PORTAL,
+ dstBeing->getTileX(), dstBeing->getTileY());
+ }
+ }
dstBeing->updateGuild();
dstBeing->addToCache();