From b35357cfcd58ac26d2f9d008a2db5b931cccb428 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Wed, 1 Oct 2014 17:39:32 +0300
Subject: Move AGI stat from net enum into attributes.

---
 src/being/attributes.h             | 1 +
 src/net/ea/eaprotocol.h            | 3 +--
 src/net/ea/playerhandler.cpp       | 4 ++--
 src/net/eathena/attrs.h            | 3 +--
 src/net/eathena/generalhandler.cpp | 2 +-
 src/net/eathena/playerhandler.cpp  | 9 +++++++--
 src/net/tmwa/attrs.h               | 3 +--
 src/net/tmwa/generalhandler.cpp    | 2 +-
 src/net/tmwa/playerhandler.cpp     | 9 +++++++--
 9 files changed, 22 insertions(+), 14 deletions(-)

(limited to 'src')

diff --git a/src/being/attributes.h b/src/being/attributes.h
index e61d39495..2bcb3a332 100644
--- a/src/being/attributes.h
+++ b/src/being/attributes.h
@@ -42,6 +42,7 @@ namespace Attributes
         SKILL_POINTS,
         CHAR_POINTS,
         CORR_POINTS,
+        AGI = 14,
         VIT = 15,
         INT = 16,
         DEX = 17,
diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h
index 3b1b02fc2..00240d574 100644
--- a/src/net/ea/eaprotocol.h
+++ b/src/net/ea/eaprotocol.h
@@ -27,8 +27,7 @@ enum
 {
     EA_JOB = 0xa,
 
-    EA_STR = 0xd,
-    EA_AGI
+    EA_STR = 0xd
 };
 
 enum
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index afc459b38..96b8e6b23 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -370,7 +370,7 @@ void PlayerHandler::setStat(const int type,
             setStatComplex(EA_STR);
             break;
         case 0x000e:
-            setStatComplex(EA_AGI);
+            setStatComplex(Attributes::AGI);
             break;
         case 0x000f:
             setStatComplex(Attributes::VIT);
@@ -458,7 +458,7 @@ void PlayerHandler::setStat(const int type,
             statusWindow->setPointsNeeded(EA_STR, base);
             break;
         case 0x0021:
-            statusWindow->setPointsNeeded(EA_AGI, base);
+            statusWindow->setPointsNeeded(Attributes::AGI, base);
             break;
         case 0x0022:
             statusWindow->setPointsNeeded(Attributes::VIT, base);
diff --git a/src/net/eathena/attrs.h b/src/net/eathena/attrs.h
index 9053886a8..77eeb5efd 100644
--- a/src/net/eathena/attrs.h
+++ b/src/net/eathena/attrs.h
@@ -29,8 +29,7 @@ namespace EAthena
     {
         JOB = 0xa,
 
-        STR = 0xd,
-        AGI
+        STR = 0xd
     };
 }  // namespace EAthena
 
diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp
index 268cd0f7a..f94594933 100644
--- a/src/net/eathena/generalhandler.cpp
+++ b/src/net/eathena/generalhandler.cpp
@@ -347,7 +347,7 @@ void GeneralHandler::gameStarted() const
     statusWindow->clearAttributes();
 
     statusWindow->addAttribute(STR, _("Strength"), "str", true);
-    statusWindow->addAttribute(AGI, _("Agility"), "agi", true);
+    statusWindow->addAttribute(Attributes::AGI, _("Agility"), "agi", true);
     statusWindow->addAttribute(Attributes::VIT, _("Vitality"), "vit", true);
     statusWindow->addAttribute(Attributes::INT,
         _("Intelligence"), "int", true);
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index ac035826d..8e3b8f910 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/playerhandler.cpp
@@ -298,11 +298,16 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg)
         msg.readUInt8("str need");
 
     val = msg.readUInt8("agi");
-    PlayerInfo::setStatBase(AGI, val);
+    PlayerInfo::setStatBase(Attributes::AGI, val);
     if (statusWindow)
-        statusWindow->setPointsNeeded(AGI, msg.readUInt8("agi cost"));
+    {
+        statusWindow->setPointsNeeded(Attributes::AGI,
+            msg.readUInt8("agi cost"));
+    }
     else
+    {
         msg.readUInt8("agi cost");
+    }
 
     val = msg.readUInt8("vit");
     PlayerInfo::setStatBase(Attributes::VIT, val);
diff --git a/src/net/tmwa/attrs.h b/src/net/tmwa/attrs.h
index 75bf75e1b..6ab80ec16 100644
--- a/src/net/tmwa/attrs.h
+++ b/src/net/tmwa/attrs.h
@@ -29,8 +29,7 @@ namespace TmwAthena
     {
         JOB = 0xa,
 
-        STR = 0xd,
-        AGI
+        STR = 0xd
     };
 }  // namespace TmwAthena
 
diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp
index a41d900c4..04536cd94 100644
--- a/src/net/tmwa/generalhandler.cpp
+++ b/src/net/tmwa/generalhandler.cpp
@@ -307,7 +307,7 @@ void GeneralHandler::gameStarted() const
     // TRANSLATORS: player stat
     statusWindow->addAttribute(STR, _("Strength"), "str", true);
     // TRANSLATORS: player stat
-    statusWindow->addAttribute(AGI, _("Agility"), "agi", true);
+    statusWindow->addAttribute(Attributes::AGI, _("Agility"), "agi", true);
     // TRANSLATORS: player stat
     statusWindow->addAttribute(Attributes::VIT, _("Vitality"), "vit", true);
     // TRANSLATORS: player stat
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp
index 6e7d4f9a6..0899e9508 100644
--- a/src/net/tmwa/playerhandler.cpp
+++ b/src/net/tmwa/playerhandler.cpp
@@ -366,11 +366,16 @@ void PlayerHandler::processPlayerStatUpdate5(Net::MessageIn &msg)
         msg.readUInt8("str cost");
 
     val = msg.readUInt8("agi");
-    PlayerInfo::setStatBase(AGI, val);
+    PlayerInfo::setStatBase(Attributes::AGI, val);
     if (statusWindow)
-        statusWindow->setPointsNeeded(AGI, msg.readUInt8("agi cost"));
+    {
+        statusWindow->setPointsNeeded(Attributes::AGI,
+            msg.readUInt8("agi cost"));
+    }
     else
+    {
         msg.readUInt8("agi cost");
+    }
 
     val = msg.readUInt8("vit");
     PlayerInfo::setStatBase(Attributes::VIT, val);
-- 
cgit v1.2.3-70-g09d2