From 3411edb5d3ae07d247421e4b8f7936a22b7b4027 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 29 May 2015 21:42:33 +0300 Subject: Convert Attributes enum into strong typed enum. --- src/net/ea/playerhandler.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/net/ea/playerhandler.cpp') 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(type)); const int points = PlayerInfo::getAttribute(Attributes::CHAR_POINTS) + oldValue - value; PlayerInfo::setAttribute(Attributes::CHAR_POINTS, points); -- cgit v1.2.3-60-g2f50