diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-10 17:19:24 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2010-01-10 17:20:33 +0100 |
commit | f5a394a5051384a930d635da22ccafc6beb1cb84 (patch) | |
tree | d28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/localplayer.cpp | |
parent | 5757066312cab082378dbc5d8df97dea3fe40af0 (diff) | |
download | mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2 mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip |
Change code style
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 95739329..58abf75f 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -640,7 +640,8 @@ void LocalPlayer::startWalking(unsigned char dir) void LocalPlayer::stopWalking(bool sendToServer) { - if (mAction == WALK && mWalkingDir) { + if (mAction == WALK && mWalkingDir) + { mWalkingDir = 0; #ifdef MANASERV_SUPPORT mLocalWalkTime = 0; @@ -1062,25 +1063,33 @@ void LocalPlayer::handleStatusEffect(StatusEffect *effect, int effectId) AnimatedSprite *sprite = effect->getIcon(); - if (!sprite) { + if (!sprite) + { // delete sprite, if necessary for (unsigned int i = 0; i < mStatusEffectIcons.size();) - if (mStatusEffectIcons[i] == effectId) { + if (mStatusEffectIcons[i] == effectId) + { mStatusEffectIcons.erase(mStatusEffectIcons.begin() + i); miniStatusWindow->eraseIcon(i); - } else i++; - } else { + } + else + i++; + } + else + { // replace sprite or append bool found = false; for (unsigned int i = 0; i < mStatusEffectIcons.size(); i++) - if (mStatusEffectIcons[i] == effectId) { + if (mStatusEffectIcons[i] == effectId) + { miniStatusWindow->setIcon(i, sprite); found = true; break; } - if (!found) { // add new + if (!found) + { // add new int offset = mStatusEffectIcons.size(); miniStatusWindow->setIcon(offset, sprite); mStatusEffectIcons.push_back(effectId); |