summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-12 20:30:46 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-12 20:31:24 +0200
commitc6a2f58d221247456946100082a580cce9733917 (patch)
tree36c3f43d1ea5973537613cf761a3300689c5d31b /src/gui
parent057c4592a0260af3efca3f7871abf24d8ed77c5d (diff)
downloadmana-c6a2f58d221247456946100082a580cce9733917.tar.gz
mana-c6a2f58d221247456946100082a580cce9733917.tar.bz2
mana-c6a2f58d221247456946100082a580cce9733917.tar.xz
mana-c6a2f58d221247456946100082a580cce9733917.zip
Some small cleanups and fixed compile with tmwserv support
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/minimap.cpp2
-rw-r--r--src/gui/partywindow.cpp10
-rw-r--r--src/gui/partywindow.h2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 160c0722..a5bdc59d 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -181,7 +181,7 @@ void Minimap::draw(gcn::Graphics *graphics)
{
case Being::PLAYER:
{
- const Player* player = static_cast<const Player*>(being);
+ const Player *player = static_cast<const Player*>(being);
Palette::ColorType type = Palette::PC;
diff --git a/src/gui/partywindow.cpp b/src/gui/partywindow.cpp
index 52a7b97e..317811ee 100644
--- a/src/gui/partywindow.cpp
+++ b/src/gui/partywindow.cpp
@@ -65,7 +65,7 @@ PartyWindow::~PartyWindow()
delete_all(mMembers);
}
-void PartyWindow::setPartyName(std::string name)
+void PartyWindow::setPartyName(const std::string &name)
{
setCaption(strprintf(_("Party (%s)"), name.c_str()));
}
@@ -125,8 +125,7 @@ void PartyWindow::updateMember(int id, const std::string &memberName,
member->avatar->setName(memberName);
member->avatar->setOnline(online);
- Player *player = dynamic_cast<Player*>(beingManager->findBeing(id));
- if (player)
+ if (Player *player = dynamic_cast<Player*>(beingManager->findBeing(id)))
player->setInParty(true);
}
@@ -141,8 +140,7 @@ void PartyWindow::removeMember(int id)
{
mMembers.erase(id);
- Player *player = dynamic_cast<Player*>(beingManager->findBeing(id));
- if (player)
+ if (Player *player = dynamic_cast<Player*>(beingManager->findBeing(id)))
player->setInParty(false);
}
@@ -210,7 +208,7 @@ void PartyWindow::action(const gcn::ActionEvent &event)
}
}
-void clearMembersSub(std::pair<int, PartyMember*> p)
+void clearMembersSub(const std::pair<int, PartyMember*> &p)
{
Player *player = dynamic_cast<Player*>(beingManager->findBeing(p.first));
if (player)
diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h
index c3fe75f4..8cea500f 100644
--- a/src/gui/partywindow.h
+++ b/src/gui/partywindow.h
@@ -65,7 +65,7 @@ class PartyWindow : public Window, gcn::ActionListener
*/
~PartyWindow();
- void setPartyName(std::string name);
+ void setPartyName(const std::string &name);
void clearPartyName();