diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-11 00:01:36 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-11 00:01:36 +0100 |
commit | dbc6444d3086fa1b7afca4605600a0a0ae8ca394 (patch) | |
tree | 929a30503728e9f657c9a8820b3a9069b916343e /src/gui/popupmenu.cpp | |
parent | 8712ce09e8f3a86dcf2f6c8ee7d030e3b41a4618 (diff) | |
download | mana-dbc6444d3086fa1b7afca4605600a0a0ae8ca394.tar.gz mana-dbc6444d3086fa1b7afca4605600a0a0ae8ca394.tar.bz2 mana-dbc6444d3086fa1b7afca4605600a0a0ae8ca394.tar.xz mana-dbc6444d3086fa1b7afca4605600a0a0ae8ca394.zip |
Removed many pointless comparisons with NULL
Sometimes it's nice for clarity, but most of the time this is just
clutter. C++ != Java. :)
Diffstat (limited to 'src/gui/popupmenu.cpp')
-rw-r--r-- | src/gui/popupmenu.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index be5252f7..3503d0ea 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -148,7 +148,7 @@ void PopupMenu::handleLink(const std::string& link) // Talk To action if (link == "talk" && - being != NULL && + being && being->getType() == Being::NPC && current_npc == 0) { @@ -157,7 +157,7 @@ void PopupMenu::handleLink(const std::string& link) // Trade action else if (link == "trade" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_node->trade(being); @@ -166,35 +166,35 @@ void PopupMenu::handleLink(const std::string& link) // Attack action else if (link == "attack" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_node->attack(being, true); } else if (link == "unignore" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_relations.setRelation(being->getName(), PlayerRelation::NEUTRAL); } else if (link == "ignore" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_relations.setRelation(being->getName(), PlayerRelation::IGNORED); } else if (link == "disregard" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_relations.setRelation(being->getName(), PlayerRelation::DISREGARDED); } else if (link == "friend" && - being != NULL && + being && being->getType() == Being::PLAYER) { player_relations.setRelation(being->getName(), PlayerRelation::FRIEND); @@ -208,7 +208,7 @@ void PopupMenu::handleLink(const std::string& link) /* // Add Buddy action - else if ((link == "buddy") && being != NULL && being->isPlayer()) + else if ((link == "buddy") && being && being->isPlayer()) { if (!buddyWindow->isVisible()) buddyWindow->setVisible(true); @@ -217,7 +217,7 @@ void PopupMenu::handleLink(const std::string& link) }*/ // Pick Up Floor Item action - else if ((link == "pickup") && mFloorItem != NULL) + else if ((link == "pickup") && mFloorItem) { player_node->pickUp(mFloorItem); } @@ -257,7 +257,7 @@ void PopupMenu::handleLink(const std::string& link) new ItemAmountWindow(AMOUNT_ITEM_DROP, inventoryWindow, mItem); } else if (link == "party-invite" && - being != NULL && + being && being->getType() == Being::PLAYER) { MessageOut outMsg(player_node->getNetwork()); |