summaryrefslogtreecommitdiff
path: root/src/gui/popupmenu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-30 16:16:09 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-30 16:16:09 +0300
commit6e6fd65992343ca37e92d24efc760666b4485160 (patch)
treecfefd917c2b33694e93902c4b96030c300ae16a0 /src/gui/popupmenu.cpp
parent6e5d8181b830694a90bba7ad5651fa0b726e4a75 (diff)
downloadManaVerse-6e6fd65992343ca37e92d24efc760666b4485160.tar.gz
ManaVerse-6e6fd65992343ca37e92d24efc760666b4485160.tar.bz2
ManaVerse-6e6fd65992343ca37e92d24efc760666b4485160.tar.xz
ManaVerse-6e6fd65992343ca37e92d24efc760666b4485160.zip
Allow open context menu in textfields before connecting to server.
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r--src/gui/popupmenu.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 544bc028c..844fc4e3f 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -675,10 +675,9 @@ void PopupMenu::showChangePos(const int x, const int y)
void PopupMenu::handleLink(const std::string &link,
gcn::MouseEvent *event A_UNUSED)
{
- if (!actorSpriteManager)
- return;
-
- Being *being = actorSpriteManager->findBeing(mBeingId);
+ Being *being = nullptr;
+ if (actorSpriteManager)
+ being = actorSpriteManager->findBeing(mBeingId);
// Talk To action
if (link == "talk" && being && being->canTalk())
@@ -724,7 +723,8 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "heal" && being && being->getType() != Being::MONSTER)
{
- actorSpriteManager->heal(being);
+ if (actorSpriteManager)
+ actorSpriteManager->heal(being);
}
else if (link == "unignore" && being &&
being->getType() == ActorSprite::PLAYER)
@@ -813,8 +813,12 @@ void PopupMenu::handleLink(const std::string &link,
}
else if (link == "nuke" && being)
{
- actorSpriteManager->addBlock(static_cast<uint32_t>(being->getId()));
- actorSpriteManager->destroy(being);
+ if (actorSpriteManager)
+ {
+ actorSpriteManager->addBlock(static_cast<uint32_t>(
+ being->getId()));
+ actorSpriteManager->destroy(being);
+ }
}
// Follow Player action
else if (link == "follow" && !mNick.empty())