summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-24 22:48:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-24 22:48:35 +0300
commitb474de4a54c9b1d4d863971e40b807588d554436 (patch)
tree761e71f86ea232d1688ee2838bd2294c59dea947 /src/net
parenta316d537dce50f4b4e1e10f5c26a7851baddbd8b (diff)
downloadplus-b474de4a54c9b1d4d863971e40b807588d554436.tar.gz
plus-b474de4a54c9b1d4d863971e40b807588d554436.tar.bz2
plus-b474de4a54c9b1d4d863971e40b807588d554436.tar.xz
plus-b474de4a54c9b1d4d863971e40b807588d554436.zip
replace defines to consts.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/specialhandler.cpp55
1 files changed, 31 insertions, 24 deletions
diff --git a/src/net/ea/specialhandler.cpp b/src/net/ea/specialhandler.cpp
index 7db3f1b31..226531a11 100644
--- a/src/net/ea/specialhandler.cpp
+++ b/src/net/ea/specialhandler.cpp
@@ -37,33 +37,33 @@
#include "debug.h"
/** job dependend identifiers (?) */
-#define SKILL_BASIC 0x0001
-#define SKILL_WARP 0x001b
-#define SKILL_STEAL 0x0032
-#define SKILL_ENVENOM 0x0034
+static const unsigned int SKILL_BASIC = 0x0001;
+static const unsigned int SKILL_WARP = 0x001b;
+static const unsigned int SKILL_STEAL = 0x0032;
+static const unsigned int SKILL_ENVENOM = 0x0034;
/** basic skills identifiers */
-#define BSKILL_TRADE 0x0000
-#define BSKILL_EMOTE 0x0001
-#define BSKILL_SIT 0x0002
-#define BSKILL_CREATECHAT 0x0003
-#define BSKILL_JOINPARTY 0x0004
-#define BSKILL_SHOUT 0x0005
+static const unsigned int BSKILL_TRADE = 0x0000;
+static const unsigned int BSKILL_EMOTE = 0x0001;
+static const unsigned int BSKILL_SIT = 0x0002;
+static const unsigned int BSKILL_CREATECHAT = 0x0003;
+static const unsigned int BSKILL_JOINPARTY = 0x0004;
+static const unsigned int BSKILL_SHOUT = 0x0005;
/** reasons why action failed */
-#define RFAIL_SKILLDEP 0x00
-#define RFAIL_INSUFSP 0x01
-#define RFAIL_INSUFHP 0x02
-#define RFAIL_NOMEMO 0x03
-#define RFAIL_SKILLDELAY 0x04
-#define RFAIL_ZENY 0x05
-#define RFAIL_WEAPON 0x06
-#define RFAIL_REDGEM 0x07
-#define RFAIL_BLUEGEM 0x08
-#define RFAIL_OVERWEIGHT 0x09
+static const unsigned int RFAIL_SKILLDEP = 0x00;
+static const unsigned int RFAIL_INSUFSP = 0x01;
+static const unsigned int RFAIL_INSUFHP = 0x02;
+static const unsigned int RFAIL_NOMEMO = 0x03;
+static const unsigned int RFAIL_SKILLDELAY = 0x04;
+static const unsigned int RFAIL_ZENY = 0x05;
+static const unsigned int RFAIL_WEAPON = 0x06;
+static const unsigned int RFAIL_REDGEM = 0x07;
+static const unsigned int RFAIL_BLUEGEM = 0x08;
+static const unsigned int RFAIL_OVERWEIGHT = 0x09;
/** should always be zero if failed */
-#define SKILL_FAILED 0x00
+static const unsigned int SKILL_FAILED = 0x00;
namespace Ea
{
@@ -129,14 +129,21 @@ void SpecialHandler::processSkillFailed(Net::MessageIn &msg)
msg.readInt16(); // btype
char success = msg.readInt8();
char reason = msg.readInt8();
- if (success != SKILL_FAILED && bskill == BSKILL_EMOTE)
+ if (success != static_cast<int>(SKILL_FAILED)
+ && bskill == static_cast<int>(BSKILL_EMOTE))
+ {
logger->log("Action: %d/%d", bskill, success);
+ }
std::string txt;
- if (success == SKILL_FAILED && skillId == SKILL_BASIC)
+ if (success == static_cast<int>(SKILL_FAILED)
+ && skillId == static_cast<int>(SKILL_BASIC))
{
- if (player_node && bskill == BSKILL_EMOTE && reason == RFAIL_SKILLDEP)
+ if (player_node && bskill == static_cast<int>(BSKILL_EMOTE)
+ && reason == static_cast<int>(RFAIL_SKILLDEP))
+ {
player_node->stopAdvert();
+ }
switch (bskill)
{