summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-03 12:26:54 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-03 12:26:54 +0300
commita75b710fbde53288d250d287eb61254e2adb3012 (patch)
treef7f1d63ebf54b576d503a7dbb56e80213145bb24 /src/being
parent6b15e62c1fefe8838bbc56cb314f3ab24ccebbc4 (diff)
downloadmv-a75b710fbde53288d250d287eb61254e2adb3012.tar.gz
mv-a75b710fbde53288d250d287eb61254e2adb3012.tar.bz2
mv-a75b710fbde53288d250d287eb61254e2adb3012.tar.xz
mv-a75b710fbde53288d250d287eb61254e2adb3012.zip
User full enum name in packets type.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp2
-rw-r--r--src/being/crazymoves.cpp22
-rw-r--r--src/being/localplayer.cpp22
3 files changed, 23 insertions, 23 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 3503b5259..38ac02c0f 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2473,7 +2473,7 @@ void Being::setGM(const bool gm)
void Being::talkTo() const
{
- if (!PacketLimiter::limitPackets(PACKET_NPC_TALK))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_NPC_TALK))
return;
npcHandler->talk(mId);
diff --git a/src/being/crazymoves.cpp b/src/being/crazymoves.cpp
index 549ffcdba..d33c0a91b 100644
--- a/src/being/crazymoves.cpp
+++ b/src/being/crazymoves.cpp
@@ -99,7 +99,7 @@ void CrazyMoves::crazyMove1()
if (localPlayer->getCurrentAction() == BeingAction::MOVE)
return;
-// if (!PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
// return;
switch (localPlayer->getDirection())
@@ -134,7 +134,7 @@ void CrazyMoves::crazyMove2()
if (localPlayer->getCurrentAction() == BeingAction::MOVE)
return;
-// if (!PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
// return;
switch (localPlayer->getDirection())
@@ -203,7 +203,7 @@ void CrazyMoves::crazyMove3()
break;
}
-// if (!PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
// return;
localPlayer->setDirection(BeingDirection::DOWN);
@@ -558,7 +558,7 @@ void CrazyMoves::crazyMoveAd()
switch (param)
{
case 'd':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
localPlayer->setDirection(BeingDirection::DOWN);
playerHandler->setDirection(
@@ -566,7 +566,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'u':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
localPlayer->setDirection(BeingDirection::UP);
playerHandler->setDirection(
@@ -574,7 +574,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'l':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
localPlayer->setDirection(BeingDirection::LEFT);
playerHandler->setDirection(
@@ -582,7 +582,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'r':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
localPlayer->setDirection(BeingDirection::RIGHT);
playerHandler->setDirection(
@@ -590,7 +590,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'L':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
uint8_t dir = 0;
switch (localPlayer->getDirection())
@@ -615,7 +615,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'R':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
uint8_t dir = 0;
switch (localPlayer->getDirection())
@@ -640,7 +640,7 @@ void CrazyMoves::crazyMoveAd()
}
break;
case 'b':
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
uint8_t dir = 0;
switch (localPlayer->getDirection())
@@ -725,7 +725,7 @@ void CrazyMoves::crazyMoveAe()
}
if (mMoveProgram[settings.crazyMoveState - 1] == 'e')
localPlayer->emote(emoteId);
- else if (PacketLimiter::limitPackets(PACKET_CHAT))
+ else if (PacketLimiter::limitPackets(PacketType::PACKET_CHAT))
petHandler->emote(emoteId, 0);
settings.crazyMoveState ++;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 7eea9c18a..6c590e82c 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -476,7 +476,7 @@ bool LocalPlayer::pickUp(FloorItem *const item)
if (!item)
return false;
- if (!PacketLimiter::limitPackets(PACKET_PICKUP))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_PICKUP))
return false;
const int dx = item->getTileX() - mX;
@@ -587,7 +587,7 @@ void LocalPlayer::setDestination(const int x, const int y)
playerHandler->setDestination(x, y, newDir);
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
setDirection(newDir);
playerHandler->setDirection(newDir);
@@ -654,7 +654,7 @@ void LocalPlayer::startWalking(const unsigned char dir)
{
// If the being can't move, just change direction
-// if (PacketLimiter::limitPackets(PACKET_DIRECTION))
+// if (PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
{
playerHandler->setDirection(dir);
setDirection(dir);
@@ -689,7 +689,7 @@ void LocalPlayer::stopWalking(const bool sendToServer)
bool LocalPlayer::toggleSit() const
{
- if (!PacketLimiter::limitPackets(PACKET_SIT))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_SIT))
return false;
BeingActionT newAction;
@@ -717,7 +717,7 @@ bool LocalPlayer::toggleSit() const
bool LocalPlayer::updateSit() const
{
- if (!PacketLimiter::limitPackets(PACKET_SIT))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_SIT))
return false;
playerHandler->changeAction(mAction);
@@ -726,7 +726,7 @@ bool LocalPlayer::updateSit() const
bool LocalPlayer::emote(const uint8_t emotion)
{
- if (!PacketLimiter::limitPackets(PACKET_EMOTE))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_EMOTE))
return false;
playerHandler->emote(emotion);
@@ -776,7 +776,7 @@ void LocalPlayer::attack(Being *const target, const bool keep,
{
setAction(BeingAction::ATTACK);
- if (!PacketLimiter::limitPackets(PACKET_ATTACK))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_ATTACK))
return;
if (!dontChangeEquipment)
@@ -795,7 +795,7 @@ void LocalPlayer::attack(Being *const target, const bool keep,
void LocalPlayer::stopAttack(const bool keepAttack)
{
- if (!PacketLimiter::limitPackets(PACKET_STOPATTACK))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_STOPATTACK))
return;
if (mServerAttack == Keep_true && mAction == BeingAction::ATTACK)
@@ -1628,7 +1628,7 @@ void LocalPlayer::tryMagic(const std::string &spell, const int baseMagic,
{
if (PlayerInfo::getAttribute(Attributes::MP) >= mana)
{
- if (!PacketLimiter::limitPackets(PACKET_CHAT))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_CHAT))
return;
chatWindow->localChatInput(spell);
@@ -2086,7 +2086,7 @@ void LocalPlayer::targetMoved() const
if (mTarget && mServerAttack == Keep_true)
{
logger->log("LocalPlayer::targetMoved0");
- if (!PacketLimiter::limitPackets(PACKET_ATTACK))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_ATTACK))
return;
logger->log("LocalPlayer::targetMoved");
playerHandler->attack(mTarget->getId(), mServerAttack);
@@ -2262,7 +2262,7 @@ void LocalPlayer::imitateDirection(const Being *const being,
if (!mPlayerImitated.empty() && being->getName() == mPlayerImitated)
{
- if (!PacketLimiter::limitPackets(PACKET_DIRECTION))
+ if (!PacketLimiter::limitPackets(PacketType::PACKET_DIRECTION))
return;
if (settings.followMode == 2)