summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-25 22:52:16 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-25 22:52:16 +0300
commita9e0c2118c8329d545065d35b0854ba29edde429 (patch)
tree0e57176638f9565165a5125357b39f48c297353a /src/net
parent30f64ba7f1f7a1d76f2dbddc05fe1d123de9c86d (diff)
downloadmv-a9e0c2118c8329d545065d35b0854ba29edde429.tar.gz
mv-a9e0c2118c8329d545065d35b0854ba29edde429.tar.bz2
mv-a9e0c2118c8329d545065d35b0854ba29edde429.tar.xz
mv-a9e0c2118c8329d545065d35b0854ba29edde429.zip
Fix being states (hercules)
Diffstat (limited to 'src/net')
-rw-r--r--src/net/eathena/beingrecv.cpp34
-rw-r--r--src/net/eathena/beingrecv.h4
2 files changed, 37 insertions, 1 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp
index f794b8091..690ae2552 100644
--- a/src/net/eathena/beingrecv.cpp
+++ b/src/net/eathena/beingrecv.cpp
@@ -363,7 +363,7 @@ void BeingRecv::processBeingVisible(Net::MessageIn &msg)
msg.readCoordinates(x, y, dir, "position");
msg.readInt8("xs");
msg.readInt8("ys");
- msg.readUInt8("action type");
+ applyPlayerAction(msg, dstBeing, msg.readUInt8("action type"));
dstBeing->setTileCoords(x, y);
if (job == 45 && socialWindow && outfitWindow)
@@ -1680,4 +1680,36 @@ void BeingRecv::processSolveCharName(Net::MessageIn &msg)
actorManager->addChar(id, name);
}
+void BeingRecv::applyPlayerAction(Net::MessageIn &msg,
+ Being *const being,
+ const uint8_t type)
+{
+ if (!being)
+ return;
+ switch (type)
+ {
+ case 0:
+ being->setAction(BeingAction::STAND, 0);
+ localPlayer->imitateAction(being, BeingAction::STAND);
+ break;
+
+ case 1:
+ if (being->getCurrentAction() != BeingAction::DEAD)
+ {
+ being->setAction(BeingAction::DEAD, 0);
+ being->recalcSpritesOrder();
+ }
+ break;
+
+ case 2:
+ being->setAction(BeingAction::SIT, 0);
+ localPlayer->imitateAction(being, BeingAction::SIT);
+ break;
+
+ default:
+ UNIMPLIMENTEDPACKET;
+ break;
+ }
+}
+
} // namespace EAthena
diff --git a/src/net/eathena/beingrecv.h b/src/net/eathena/beingrecv.h
index ed51f1b4e..0c26d07b7 100644
--- a/src/net/eathena/beingrecv.h
+++ b/src/net/eathena/beingrecv.h
@@ -115,6 +115,10 @@ namespace EAthena
const BeingId id,
const int16_t job,
const BeingType::BeingType beingType);
+ void applyPlayerAction(Net::MessageIn &msg,
+ Being *const being,
+ const uint8_t type);
+
} // namespace BeingRecv
} // namespace EAthena