summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 00:27:05 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 00:32:19 +0100
commitdfcc6397848d4597b386b688f689352de6c19ae2 (patch)
treea6e8c9afd6a49ea96e4498080a96d3e06ecaebd7 /src/being.cpp
parentcd20fb3432498b8871401bdd65a143197e2a6538 (diff)
downloadmana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.gz
mana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.bz2
mana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.xz
mana-dfcc6397848d4597b386b688f689352de6c19ae2.zip
Remove redundancy, fix variable names and other code cleanups
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/being.cpp b/src/being.cpp
index c0623255..921ed75e 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -90,7 +90,6 @@ Being::Being(int id, int job, Map *map):
mSpriteDirection(DIRECTION_DOWN),
#endif
mMap(NULL),
- mName(""),
mIsGM(false),
mParticleEffects(config.getValue("particleeffects", 1)),
mEquippedWeapon(NULL),
@@ -120,7 +119,6 @@ Being::Being(int id, int job, Map *map):
mSpeechBubble = new SpeechBubble;
- mSpeech = "";
mNameColor = &guiPalette->getColor(Palette::CHAT);
mText = 0;
}
@@ -916,32 +914,18 @@ int Being::getOffset(char pos, char neg) const
int Being::getWidth() const
{
- if (mSprites[BASE_SPRITE])
- {
- const int width = mSprites[BASE_SPRITE]->getWidth() > DEFAULT_WIDTH ?
- mSprites[BASE_SPRITE]->getWidth() :
- DEFAULT_WIDTH;
- return width;
- }
+ if (AnimatedSprite *base = mSprites[BASE_SPRITE])
+ return std::max(base->getWidth(), DEFAULT_WIDTH);
else
- {
return DEFAULT_WIDTH;
- }
}
int Being::getHeight() const
{
- if (mSprites[BASE_SPRITE])
- {
- const int height = mSprites[BASE_SPRITE]->getHeight() > DEFAULT_HEIGHT ?
- mSprites[BASE_SPRITE]->getHeight() :
- DEFAULT_HEIGHT;
- return height;
- }
+ if (AnimatedSprite *base = mSprites[BASE_SPRITE])
+ return std::max(base->getHeight(), DEFAULT_HEIGHT);
else
- {
return DEFAULT_HEIGHT;
- }
}
void Being::setTargetAnimation(SimpleAnimation* animation)