From 2fe16d770e2d0990e74711039a15a47d6a57782d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Sep 2014 18:34:14 +0300 Subject: Use haveServerHp feature in getting hp in tmwa. Also use haveServerHp in drawing hp bar. --- src/net/tmwa/beinghandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/net/tmwa') 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"); -- cgit v1.2.3-70-g09d2