summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-19 18:49:30 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-19 18:49:30 +0300
commit3e90ddd9ab26d75a6a1e59df096ccdb284247801 (patch)
tree96f676764931a9fa3b82282aff6725647c43335d /src
parent3420babbbc6d10f1fc5be7ff7b895e618acd5f0e (diff)
downloadplus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.gz
plus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.bz2
plus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.tar.xz
plus-3e90ddd9ab26d75a6a1e59df096ccdb284247801.zip
Add extended riding support (hercules)
Diffstat (limited to 'src')
-rw-r--r--src/net/eathena/beingrecv.cpp32
-rw-r--r--src/resources/db/horsedb.cpp2
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;
}