diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-19 18:49:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-19 18:49:30 +0300 |
commit | 3e90ddd9ab26d75a6a1e59df096ccdb284247801 (patch) | |
tree | 96f676764931a9fa3b82282aff6725647c43335d /src/net/eathena/beingrecv.cpp | |
parent | 3420babbbc6d10f1fc5be7ff7b895e618acd5f0e (diff) | |
download | manaplus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.gz manaplus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.bz2 manaplus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.xz manaplus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.zip |
Add extended riding support (hercules)
Diffstat (limited to 'src/net/eathena/beingrecv.cpp')
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/net/eathena/beingrecv.cpp b/src/net/eathena/beingrecv.cpp index 23f731c2d..590d86cad 100644 --- a/src/net/eathena/beingrecv.cpp +++ b/src/net/eathena/beingrecv.cpp @@ -1363,21 +1363,35 @@ void BeingRecv::processBeingAttrs(Net::MessageIn &msg) const int len = msg.readInt16("len"); if (len < 12) return; + const bool haveMount = serverFeatures->haveExtendedRiding(); + if (haveMount && len < 14) + return; + Being *const dstBeing = actorManager->findBeing( msg.readBeingId("player id")); const int gmLevel = msg.readInt32("gm level"); - if (dstBeing && gmLevel) + uint16_t mount = 0; + if (haveMount) + mount = msg.readInt16("mount"); + if (dstBeing) { - if (dstBeing == localPlayer) - localPlayer->setGMLevel(gmLevel); - dstBeing->setGM(true); + if (gmLevel) + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(gmLevel); + dstBeing->setGM(true); + } + else + { + if (dstBeing == localPlayer) + localPlayer->setGMLevel(0); + if (dstBeing) + dstBeing->setGM(false); + } } - else + if (haveMount) { - if (dstBeing == localPlayer) - localPlayer->setGMLevel(0); - if (dstBeing) - dstBeing->setGM(false); + dstBeing->setHorse(mount); } } |