summaryrefslogtreecommitdiff
path: root/src/net/ea/beinghandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-29 20:59:14 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-29 20:59:14 +0300
commit390e5da0f9ecc4407aa7d4bcba1af5730db56271 (patch)
treeee0879cba3fec38740f1e51f2d1d35719ec3d8ae /src/net/ea/beinghandler.cpp
parent9f1994182d4225f630a93ae06b01927c4f7a9a37 (diff)
downloadmv-390e5da0f9ecc4407aa7d4bcba1af5730db56271.tar.gz
mv-390e5da0f9ecc4407aa7d4bcba1af5730db56271.tar.bz2
mv-390e5da0f9ecc4407aa7d4bcba1af5730db56271.tar.xz
mv-390e5da0f9ecc4407aa7d4bcba1af5730db56271.zip
Convert AttackType enum into strong typed enum.
Diffstat (limited to 'src/net/ea/beinghandler.cpp')
-rw-r--r--src/net/ea/beinghandler.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp
index ba1d21fbd..a80a9d4f6 100644
--- a/src/net/ea/beinghandler.cpp
+++ b/src/net/ea/beinghandler.cpp
@@ -178,7 +178,8 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg)
msg.readInt32("dst speed");
const int param1 = msg.readInt16("param1");
msg.readInt16("param 2");
- const uint8_t type = msg.readUInt8("type");
+ const AttackTypeT type = static_cast<AttackTypeT>(
+ msg.readUInt8("type"));
msg.readInt16("param 3");
switch (type)
@@ -201,17 +202,17 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg)
{
// level not present, using 1
dstBeing->takeDamage(srcBeing, param1,
- static_cast<AttackType::Type>(type), 1);
+ static_cast<AttackTypeT>(type), 1);
}
break;
- case 0x01: // dead or pickup?
+ case AttackType::PICKUP:
break;
// tmw server can send here garbage?
// if (srcBeing)
// srcBeing->setAction(BeingAction::DEAD, 0);
- case 0x02: // Sit
+ case AttackType::SIT:
if (srcBeing)
{
srcBeing->setAction(BeingAction::SIT, 0);
@@ -224,7 +225,7 @@ void BeingHandler::processBeingAction(Net::MessageIn &msg)
}
break;
- case 0x03: // Stand up
+ case AttackType::STAND:
if (srcBeing)
{
srcBeing->setAction(BeingAction::STAND, 0);