From 16cc2e4a4204ee95e8256f3d7eacaada99f53309 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Mar 2016 21:01:16 +0300 Subject: Fix a bit formatting in Being::drawSpriteAt. --- src/being/being.cpp | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/being/being.cpp b/src/being/being.cpp index cb276801a..c058380c1 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2941,9 +2941,9 @@ void Being::drawSpriteAt(Graphics *restrict const graphics, gui->getFont()->drawString(graphics, color, color, mName, x, y); } } - - if (mHighlightMonsterAttackRange && mType == ActorType::Monster - && isAlive()) + else if (mHighlightMonsterAttackRange && + mType == ActorType::Monster && + isAlive()) { int attackRange; if (mAttackRange) @@ -2961,8 +2961,11 @@ void Being::drawSpriteAt(Graphics *restrict const graphics, CompoundSprite::draw(graphics, x, y); - if (mShowMobHP && mInfo && localPlayer && localPlayer->getTarget() == this - && mType == ActorType::Monster) + if (mShowMobHP && + mInfo && + localPlayer && + localPlayer->getTarget() == this && + mType == ActorType::Monster) { // show hp bar here int maxHP = mMaxHP; @@ -2980,17 +2983,21 @@ void Being::drawSpriteAt(Graphics *restrict const graphics, 2 * 50, 4); } - if (mShowOwnHP - && mInfo - && localPlayer == this - && mAction != BeingAction::DEAD) + if (mShowOwnHP && + mInfo && + localPlayer == this && + mAction != BeingAction::DEAD) { - drawHpBar(graphics, PlayerInfo::getAttribute(Attributes::MAX_HP), - PlayerInfo::getAttribute(Attributes::HP), 0, - UserColorId::PLAYER_HP, UserColorId::PLAYER_HP2, - x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(), - y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), - 2 * 50, 4); + drawHpBar(graphics, + PlayerInfo::getAttribute(Attributes::MAX_HP), + PlayerInfo::getAttribute(Attributes::HP), + 0, + UserColorId::PLAYER_HP, + UserColorId::PLAYER_HP2, + x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(), + y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), + 2 * 50, + 4); } } -- cgit v1.2.3-60-g2f50