diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-31 01:29:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-31 01:29:22 +0300 |
commit | d120817f73712bf2fd22be231200df752760d0d3 (patch) | |
tree | 4ba6594af7585d220761fa5f7a8b9a8b17a7003c /src/being | |
parent | d86a26ea47f5ae35bd112c7fdb8b13c7663d75d8 (diff) | |
download | mv-d120817f73712bf2fd22be231200df752760d0d3.tar.gz mv-d120817f73712bf2fd22be231200df752760d0d3.tar.bz2 mv-d120817f73712bf2fd22be231200df752760d0d3.tar.xz mv-d120817f73712bf2fd22be231200df752760d0d3.zip |
Fix random wrong name position at players top.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 73ee9cec0..6eae50281 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2287,9 +2287,16 @@ void Being::drawEmotion(Graphics *restrict const graphics, { x = px + 8 - mBadgesCount * 8; if (mVisibleNamePos == VisibleNamePos::Buttom) + { y = mDispName->getY() - offsetY; + } else - y = py + getHeight() + 16; + { + int height = getHeight(); + if (height < 64) + height = 64; + y = py + height + 16; + } } else { @@ -2310,10 +2317,13 @@ void Being::drawEmotion(Graphics *restrict const graphics, else if (mShowBadges == BadgeDrawType::Bottom) { x = px + 8 - mBadgesCount * 8; + int height = getHeight(); + if (height < 64) + height = 64; if (mVisibleNamePos == VisibleNamePos::Buttom) - y = py + getHeight(); + y = py + height; else - y = py + getHeight() + 16; + y = py + height + 16; } else { @@ -2447,7 +2457,10 @@ void Being::updateCoords() restrict2 if (mType == ActorType::Monster || mVisibleNamePos == VisibleNamePos::Top) { - offsetY += - getHeight() - mDispName->getHeight(); + int height = getHeight(); + if (height < 64) + height = 64; + offsetY += - height - mDispName->getHeight(); } mDispName->adviseXY(offsetX, offsetY, mMoveNames); |