summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/charcreatedialog.cpp10
-rw-r--r--src/net/tmwserv/beinghandler.cpp19
2 files changed, 16 insertions, 13 deletions
diff --git a/src/gui/charcreatedialog.cpp b/src/gui/charcreatedialog.cpp
index aa7f7051..8922c8f6 100644
--- a/src/gui/charcreatedialog.cpp
+++ b/src/gui/charcreatedialog.cpp
@@ -161,7 +161,7 @@ void CharCreateDialog::action(const gcn::ActionEvent &event)
mCreateButton->setEnabled(false);
std::vector<int> atts;
- for (int i = 0; i < mAttributeSlider.size(); i++)
+ for (unsigned i = 0; i < mAttributeSlider.size(); i++)
{
atts.push_back((int) mAttributeSlider[i]->getValue());
}
@@ -214,7 +214,7 @@ std::string CharCreateDialog::getName()
void CharCreateDialog::updateSliders()
{
- for (int i = 0; i < mAttributeSlider.size(); i++)
+ for (unsigned i = 0; i < mAttributeSlider.size(); i++)
{
// Update captions
mAttributeValue[i]->setCaption(
@@ -254,7 +254,7 @@ int CharCreateDialog::getDistributedPoints()
{
int points = 0;
- for (int i = 0; i < mAttributeSlider.size(); i++)
+ for (unsigned i = 0; i < mAttributeSlider.size(); i++)
{
points += (int) mAttributeSlider[i]->getValue();
}
@@ -266,7 +266,7 @@ void CharCreateDialog::setAttributes(std::vector<std::string> labels,
{
mMaxPoints = available;
- for (int i = 0; i < mAttributeLabel.size(); i++)
+ for (unsigned i = 0; i < mAttributeLabel.size(); i++)
{
remove(mAttributeLabel[i]);
delete mAttributeLabel[i];
@@ -283,7 +283,7 @@ void CharCreateDialog::setAttributes(std::vector<std::string> labels,
int w = 200;
int h = 330;
- for (int i = 0; i < labels.size(); i++)
+ for (unsigned i = 0; i < labels.size(); i++)
{
mAttributeLabel[i] = new gcn::Label(labels[i]);
mAttributeLabel[i]->setWidth(70);
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp
index 0752497e..292a3e3f 100644
--- a/src/net/tmwserv/beinghandler.cpp
+++ b/src/net/tmwserv/beinghandler.cpp
@@ -264,10 +264,11 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
void BeingHandler::handleBeingAttackMessage(MessageIn &msg)
{
Being *being = beingManager->findBeing(msg.readInt16());
- int direction = msg.readInt8();
- int attackType = msg.readInt8();
+ const int direction = msg.readInt8();
+ const int attackType = msg.readInt8();
- if (!being) return;
+ if (!being)
+ return;
switch (direction)
{
@@ -295,13 +296,14 @@ void BeingHandler::handleBeingsDamageMessage(MessageIn &msg)
void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
{
- Being* being = beingManager->findBeing(msg.readInt16());
+ Being *being = beingManager->findBeing(msg.readInt16());
Being::Action action = (Being::Action) msg.readInt8();
- if (!being) return;
+ if (!being)
+ return;
being->setAction(action);
- if (action == Being::DEAD && being==player_node)
+ if (action == Being::DEAD && being == player_node)
{
static char const *const deadMsg[] =
{
@@ -330,8 +332,9 @@ void BeingHandler::handleBeingActionChangeMessage(MessageIn &msg)
void BeingHandler::handleBeingLooksChangeMessage(MessageIn &msg)
{
Being *being = beingManager->findBeing(msg.readInt16());
- if (!being || being->getType() != Being::PLAYER) return;
- Player * player = static_cast< Player * >(being);
+ if (!being || being->getType() != Being::PLAYER)
+ return;
+ Player *player = static_cast<Player *>(being);
handleLooks(player, msg);
if (msg.getUnreadLength())
{