summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/playerhandler.cpp7
-rw-r--r--src/net/ea/playerhandler.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index 0003a0a7e..8d4937236 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -61,7 +61,7 @@ PlayerHandler::PlayerHandler()
{
}
-void PlayerHandler::decreaseAttribute(const int attr A_UNUSED) const
+void PlayerHandler::decreaseAttribute(const AttributesT attr A_UNUSED) const
{
}
@@ -198,13 +198,14 @@ void PlayerHandler::processPlayerStatUpdate3(Net::MessageIn &msg)
void PlayerHandler::processPlayerStatUpdate4(Net::MessageIn &msg)
{
BLOCK_START("PlayerHandler::processPlayerStatUpdate4")
- const int type = msg.readInt16("type");
+ const uint16_t type = msg.readInt16("type");
const uint8_t ok = msg.readUInt8("flag");
const int value = msg.readUInt8("value");
if (ok != 1)
{
- const int oldValue = PlayerInfo::getStatBase(type);
+ const int oldValue = PlayerInfo::getStatBase(
+ static_cast<AttributesT>(type));
const int points = PlayerInfo::getAttribute(Attributes::CHAR_POINTS)
+ oldValue - value;
PlayerInfo::setAttribute(Attributes::CHAR_POINTS, points);
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index 760f52af7..4f443c8bf 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -42,7 +42,7 @@ class PlayerHandler notfinal : public Net::PlayerHandler
A_DELETE_COPY(PlayerHandler)
- void decreaseAttribute(const int attr) const override final;
+ void decreaseAttribute(const AttributesT attr) const override final;
void ignorePlayer(const std::string &player,
const bool ignore) const override final;