diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-16 18:28:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-16 18:28:32 +0300 |
commit | 7852b453367e7cbfd82f4262a46505152759ddce (patch) | |
tree | 40023728f353941d4cbf56f9269a1127ed1b5e82 | |
parent | deab6490899aa2c80861e47ccd3f043b712cae96 (diff) | |
download | manaplus-7852b453367e7cbfd82f4262a46505152759ddce.tar.gz manaplus-7852b453367e7cbfd82f4262a46505152759ddce.tar.bz2 manaplus-7852b453367e7cbfd82f4262a46505152759ddce.tar.xz manaplus-7852b453367e7cbfd82f4262a46505152759ddce.zip |
Fix player and monsters hp bars in evol server.
-rw-r--r-- | src/being.cpp | 46 |
1 files changed, 33 insertions, 13 deletions
diff --git a/src/being.cpp b/src/being.cpp index af3b14419..39d0bd450 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2071,20 +2071,40 @@ void Being::drawHpBar(Graphics *graphics, int maxHP, int hp, int damage, int dx = static_cast<int>(static_cast<float>(width) / p); - if ((!damage && (this != player_node || hp == maxHP) && serverVersion < 1) - || (!hp && maxHP == damage)) - { - graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(gcn::Rectangle( - x, y, dx, height)); - return; + if (serverVersion < 1) + { // old servers + if ((!damage && (this != player_node || hp == maxHP)) + || (!hp && maxHP == damage)) + { + graphics->setColor(userPalette->getColorWithAlpha(color1)); + graphics->fillRectangle(gcn::Rectangle( + x, y, dx, height)); + return; + } + else if (width - dx <= 0) + { + graphics->setColor(userPalette->getColorWithAlpha(color2)); + graphics->fillRectangle(gcn::Rectangle( + x, y, width, height)); + return; + } } - else if (width - dx <= 0) - { - graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(gcn::Rectangle( - x, y, width, height)); - return; + else + { // evol servers + if (hp == maxHP) + { + graphics->setColor(userPalette->getColorWithAlpha(color1)); + graphics->fillRectangle(gcn::Rectangle( + x, y, dx, height)); + return; + } + else if (width - dx <= 0) + { + graphics->setColor(userPalette->getColorWithAlpha(color2)); + graphics->fillRectangle(gcn::Rectangle( + x, y, width, height)); + return; + } } graphics->setColor(userPalette->getColorWithAlpha(color1)); |