summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-12 19:12:15 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-12 19:12:15 +0300
commit814e88e5ca69bc54837be27429dbf42dd41f7ac6 (patch)
tree301671c06b758239f9b05b3a0e4f2774e5ab3a9e /src/net/eathena
parent261b8ab980d442d0cf1b06df244388d65f431301 (diff)
downloadmv-814e88e5ca69bc54837be27429dbf42dd41f7ac6.tar.gz
mv-814e88e5ca69bc54837be27429dbf42dd41f7ac6.tar.bz2
mv-814e88e5ca69bc54837be27429dbf42dd41f7ac6.tar.xz
mv-814e88e5ca69bc54837be27429dbf42dd41f7ac6.zip
Move being action into separate file.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/beinghandler.cpp22
-rw-r--r--src/net/eathena/playerhandler.cpp16
-rw-r--r--src/net/eathena/playerhandler.h3
3 files changed, 21 insertions, 20 deletions
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index efa22e490..a6716a661 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -544,8 +544,8 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
dstBeing->setDirectionDelayed(static_cast<uint8_t>(d));
}
- if (player_node->getCurrentAction() != Being::STAND)
- player_node->imitateAction(dstBeing, Being::STAND);
+ if (player_node->getCurrentAction() != BeingAction::STAND)
+ player_node->imitateAction(dstBeing, BeingAction::STAND);
if (player_node->getDirection() != dstBeing->getDirection())
{
player_node->imitateDirection(dstBeing,
@@ -573,21 +573,21 @@ void BeingHandler::processPlayerMoveUpdate(Net::MessageIn &msg,
switch (type)
{
case 0:
- dstBeing->setAction(Being::STAND, 0);
- player_node->imitateAction(dstBeing, Being::STAND);
+ dstBeing->setAction(BeingAction::STAND, 0);
+ player_node->imitateAction(dstBeing, BeingAction::STAND);
break;
case 1:
- if (dstBeing->getCurrentAction() != Being::DEAD)
+ if (dstBeing->getCurrentAction() != BeingAction::DEAD)
{
- dstBeing->setAction(Being::DEAD, 0);
+ dstBeing->setAction(BeingAction::DEAD, 0);
dstBeing->recalcSpritesOrder();
}
break;
case 2:
- dstBeing->setAction(Being::SIT, 0);
- player_node->imitateAction(dstBeing, Being::SIT);
+ dstBeing->setAction(BeingAction::SIT, 0);
+ player_node->imitateAction(dstBeing, BeingAction::SIT);
break;
default:
@@ -690,13 +690,13 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
if (spawnId)
{
- dstBeing->setAction(Being::SPAWN, 0);
+ dstBeing->setAction(BeingAction::SPAWN, 0);
}
else if (visible)
{
dstBeing->clearPath();
dstBeing->setActionTime(tick_time);
- dstBeing->setAction(Being::STAND, 0);
+ dstBeing->setAction(BeingAction::STAND, 0);
}
// Prevent division by 0 when calculating frame
@@ -776,7 +776,7 @@ void BeingHandler::processBeingVisibleOrMove(Net::MessageIn &msg,
{
uint16_t srcX, srcY, dstX, dstY;
msg.readCoordinatePair(srcX, srcY, dstX, dstY);
- dstBeing->setAction(Being::STAND, 0);
+ dstBeing->setAction(BeingAction::STAND, 0);
dstBeing->setTileCoords(srcX, srcY);
dstBeing->setDestination(dstX, dstY);
}
diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp
index 627e5479f..17c8a6a41 100644
--- a/src/net/eathena/playerhandler.cpp
+++ b/src/net/eathena/playerhandler.cpp
@@ -183,23 +183,23 @@ void PlayerHandler::setDestination(const int x, const int y,
static_cast<unsigned char>(direction));
}
-void PlayerHandler::changeAction(const Being::Action &action) const
+void PlayerHandler::changeAction(const BeingAction::Action &action) const
{
unsigned char type;
switch (action)
{
- case Being::SIT:
+ case BeingAction::SIT:
type = 2;
break;
- case Being::STAND:
+ case BeingAction::STAND:
type = 3;
break;
default:
- case Being::MOVE:
- case Being::ATTACK:
- case Being::DEAD:
- case Being::HURT:
- case Being::SPAWN:
+ case BeingAction::MOVE:
+ case BeingAction::ATTACK:
+ case BeingAction::DEAD:
+ case BeingAction::HURT:
+ case BeingAction::SPAWN:
return;
}
diff --git a/src/net/eathena/playerhandler.h b/src/net/eathena/playerhandler.h
index 087c42973..3881150cb 100644
--- a/src/net/eathena/playerhandler.h
+++ b/src/net/eathena/playerhandler.h
@@ -50,7 +50,8 @@ class PlayerHandler final : public MessageHandler, public Ea::PlayerHandler
void setDirection(const unsigned char direction) const override final;
void setDestination(const int x, const int y,
const int direction) const override final;
- void changeAction(const Being::Action &action) const override final;
+ void changeAction(const BeingAction::Action &action)
+ const override final;
void updateStatus(const uint8_t status) const override final;
static void processPlayerShortcuts(Net::MessageIn &msg);