summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being/being.cpp5
-rw-r--r--src/net/tmwa/beinghandler.cpp7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 57e212b6a..853fb20d6 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -61,6 +61,7 @@
#include "net/packetlimiter.h"
#include "net/pethandler.h"
#include "net/playerhandler.h"
+#include "net/serverfeatures.h"
#include "resources/attack.h"
#include "resources/emoteinfo.h"
@@ -2467,7 +2468,7 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp,
const int dx = static_cast<const int>(static_cast<float>(width) / p);
- if (serverVersion < 1)
+ if (!Net::getServerFeatures()->haveServerHp())
{ // old servers
if ((!damage && (this != localPlayer || hp == maxHP))
|| (!hp && maxHP == damage))
@@ -2486,7 +2487,7 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp,
}
}
else
- { // evol servers
+ {
if (hp == maxHP)
{
graphics->setColor(userPalette->getColorWithAlpha(color1));
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index 75f1e2875..5b62cafb4 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -36,8 +36,11 @@
#include "gui/windows/outfitwindow.h"
#include "gui/windows/socialwindow.h"
+#include "net/net.h"
+
#include "net/tmwa/messageout.h"
#include "net/tmwa/protocol.h"
+#include "net/tmwa/serverfeatures.h"
#include "net/tmwa/sprite.h"
#include "resources/iteminfo.h"
@@ -1102,7 +1105,7 @@ void BeingHandler::processBeingVisible(Net::MessageIn &msg)
uint16_t gloves;
if (dstBeing->getType() == ActorType::Monster)
{
- if (serverVersion > 0 || tmwServerVersion >= 0x0E0701)
+ if (Net::getServerFeatures()->haveServerHp())
{
const int hp = msg.readInt32("hp");
const int maxHP = msg.readInt32("max hp");
@@ -1305,7 +1308,7 @@ void BeingHandler::processBeingMove(Net::MessageIn &msg)
uint16_t gloves;
if (dstBeing->getType() == ActorType::Monster)
{
- if (serverVersion > 0 || tmwServerVersion >= 0x0E0701)
+ if (Net::getServerFeatures()->haveServerHp())
{
const int hp = msg.readInt32("hp");
const int maxHP = msg.readInt32("max hp");