diff options
-rw-r--r-- | src/net/eathena/beingrecv.cpp | 32 | ||||
-rw-r--r-- | src/resources/db/horsedb.cpp | 2 |
2 files changed, 25 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); } } diff --git a/src/resources/db/horsedb.cpp b/src/resources/db/horsedb.cpp index df1e6345c..db8aa7dc3 100644 --- a/src/resources/db/horsedb.cpp +++ b/src/resources/db/horsedb.cpp @@ -191,6 +191,8 @@ void HorseDB::unload() delete_all(mUnknown.upSprites); delete_all(mUnknown.downSprites); + mUnknown.upSprites.clear(); + mUnknown.downSprites.clear(); mLoaded = false; } |