diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:22:33 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:36:14 +0200 |
commit | 2a3f16f5673e6482e422a65f6f23f958dd78955f (patch) | |
tree | 63f81e0fc00e9a2f29bfe3ca0e13e2351994de0b | |
parent | 1b44c6d73784c0f222c3d1f09214936acb5561f7 (diff) | |
download | mana-2a3f16f5673e6482e422a65f6f23f958dd78955f.tar.gz mana-2a3f16f5673e6482e422a65f6f23f958dd78955f.tar.bz2 mana-2a3f16f5673e6482e422a65f6f23f958dd78955f.tar.xz mana-2a3f16f5673e6482e422a65f6f23f958dd78955f.zip |
Assorted random cleanups
-rw-r--r-- | src/gui/chat.cpp | 7 | ||||
-rw-r--r-- | src/gui/chat.h | 5 | ||||
-rw-r--r-- | src/gui/palette.cpp | 2 | ||||
-rw-r--r-- | src/gui/sell.cpp | 3 | ||||
-rw-r--r-- | src/map.h | 2 | ||||
-rw-r--r-- | src/particlecontainer.h | 2 | ||||
-rw-r--r-- | src/shopitem.h | 10 |
7 files changed, 18 insertions, 13 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 7ad727ff..14a2dd49 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -412,9 +412,10 @@ void ChatWindow::setRecordingFile(const std::string &msg) mRecorder->setRecordingFile(msg); } -void ChatWindow::whisper(std::string nick, std::string mes, bool own) +void ChatWindow::whisper(const std::string &nick, std::string mes, bool own) { - if (mes.length() == 0) return; + if (mes.length() == 0) + return; std::string playerName = player_node->getName(); std::string tempNick = nick; @@ -453,7 +454,7 @@ void ChatWindow::whisper(std::string nick, std::string mes, bool own) } } -ChatTab *ChatWindow::addWhisperTab(std::string nick) +ChatTab *ChatWindow::addWhisperTab(const std::string &nick) { std::string playerName = player_node->getName(); std::string tempNick = nick; diff --git a/src/gui/chat.h b/src/gui/chat.h index 9f762f8e..21f80f13 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -171,9 +171,10 @@ class ChatWindow : public Window, void doPresent(); - void whisper(std::string nick, std::string mes, bool own = false); + void whisper(const std::string &nick, std::string mes, + bool own = false); - ChatTab *addWhisperTab(std::string nick); + ChatTab *addWhisperTab(const std::string &nick); protected: friend class ChatTab; diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index d06d589f..5395baf5 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -274,7 +274,7 @@ void Palette::addColor(Palette::ColorType type, int rgb, mGradVector.push_back(&mColVector[type]); } -void Palette::advanceGradient () +void Palette::advanceGradient() { if (get_elapsed_time(mRainbowTime) > 5) { diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index c450cd2d..f940856d 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -283,7 +283,8 @@ void SellDialog::logic() { Window::logic(); - if (!current_npc) setVisible(false); + if (!current_npc) + setVisible(false); } void SellDialog::setVisible(bool visible) @@ -53,7 +53,7 @@ struct MetaTile /** * Constructor. */ - MetaTile():whichList(0), blockmask(0) {}; + MetaTile() : whichList(0), blockmask(0) {} // Pathfinding members int Fcost; /**< Estimation of total path cost */ diff --git a/src/particlecontainer.h b/src/particlecontainer.h index 26539dd7..90825024 100644 --- a/src/particlecontainer.h +++ b/src/particlecontainer.h @@ -52,7 +52,7 @@ public: /** * Kills and removes all particle effects (only in this container) */ - virtual void clearLocally() {}; + virtual void clearLocally() {} /** * Sets the positions of all elements diff --git a/src/shopitem.h b/src/shopitem.h index f552c0fe..33021d8c 100644 --- a/src/shopitem.h +++ b/src/shopitem.h @@ -63,21 +63,22 @@ class ShopItem : public Item * @param inventoryIndex the inventory index of the item * @param quantity number of available copies of the item */ - void addDuplicate (int inventoryIndex, int quantity); + void addDuplicate(int inventoryIndex, int quantity); /** * Add a duplicate. Id and price will be taken from this item. * Needed for compatibility with ShopDuplicateItems (see) class * documentation). */ - void addDuplicate (); + void addDuplicate(); /** * Gets the quantity of the currently topmost duplicate. * * @return the quantity of the currently topmost duplicate */ - int getCurrentQuantity() { + int getCurrentQuantity() const + { return mDuplicates.empty() ? 0 : mDuplicates.top()->quantity; } @@ -86,7 +87,8 @@ class ShopItem : public Item * * @return the inventory index of the currently topmost duplicate */ - int getCurrentInvIndex() { + int getCurrentInvIndex() const + { return mDuplicates.empty() ? mInvIndex : mDuplicates.top()->inventoryIndex; } |