summaryrefslogtreecommitdiff
path: root/src/net/tmwa
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-01 17:44:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-01 19:28:09 +0300
commit1d6c226f2aae2410f9785709aefd88f1a17e6bca (patch)
treeb5d1d89f8c0418c3c0a95875285ac4c9350692b8 /src/net/tmwa
parentb35357cfcd58ac26d2f9d008a2db5b931cccb428 (diff)
downloadplus-1d6c226f2aae2410f9785709aefd88f1a17e6bca.tar.gz
plus-1d6c226f2aae2410f9785709aefd88f1a17e6bca.tar.bz2
plus-1d6c226f2aae2410f9785709aefd88f1a17e6bca.tar.xz
plus-1d6c226f2aae2410f9785709aefd88f1a17e6bca.zip
Move STR stat from net enum into attributes.
Diffstat (limited to 'src/net/tmwa')
-rw-r--r--src/net/tmwa/attrs.h4
-rw-r--r--src/net/tmwa/charserverhandler.cpp5
-rw-r--r--src/net/tmwa/generalhandler.cpp2
-rw-r--r--src/net/tmwa/playerhandler.cpp11
4 files changed, 14 insertions, 8 deletions
diff --git a/src/net/tmwa/attrs.h b/src/net/tmwa/attrs.h
index 6ab80ec16..060e44c71 100644
--- a/src/net/tmwa/attrs.h
+++ b/src/net/tmwa/attrs.h
@@ -27,9 +27,7 @@ namespace TmwAthena
{
enum
{
- JOB = 0xa,
-
- STR = 0xd
+ JOB = 0xa
};
} // namespace TmwAthena
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index adf82cf34..b1d1fa055 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -197,7 +197,10 @@ void CharServerHandler::readPlayerData(Net::MessageIn &msg,
character->dummy = tempPlayer;
for (int i = 0; i < 6; i++)
- character->data.mStats[i + STR].base = msg.readUInt8("stat");
+ {
+ character->data.mStats[i + Attributes::STR].base
+ = msg.readUInt8("stat");
+ }
if (withColors)
{
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index 04536cd94..a888cb106 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -305,7 +305,7 @@ void GeneralHandler::gameStarted() const
statusWindow->clearAttributes();
// TRANSLATORS: player stat
- statusWindow->addAttribute(STR, _("Strength"), "str", true);
+ statusWindow->addAttribute(Attributes::STR, _("Strength"), "str", true);
// TRANSLATORS: player stat
statusWindow->addAttribute(Attributes::AGI, _("Agility"), "agi", true);
// TRANSLATORS: player stat
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 0899e9508..89ba976a9 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -161,7 +161,7 @@ void PlayerHandler::emote(const uint8_t emoteId) const
void PlayerHandler::increaseAttribute(const int attr) const
{
- if (attr >= STR && attr <= Attributes::LUK)
+ if (attr >= Attributes::STR && attr <= Attributes::LUK)
{
createOutPacket(CMSG_STAT_UPDATE_REQUEST);
outMsg.writeInt16(static_cast<int16_t>(attr));
@@ -359,11 +359,16 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg)
msg.readInt16("char points"));
unsigned int val = msg.readUInt8("str");
- PlayerInfo::setStatBase(STR, val);
+ PlayerInfo::setStatBase(Attributes::STR, val);
if (statusWindow)
- statusWindow->setPointsNeeded(STR, msg.readUInt8("str cost"));
+ {
+ statusWindow->setPointsNeeded(Attributes::STR,
+ msg.readUInt8("str cost"));
+ }
else
+ {
msg.readUInt8("str cost");
+ }
val = msg.readUInt8("agi");
PlayerInfo::setStatBase(Attributes::AGI, val);