diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-12 16:54:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-12 16:54:55 +0300 |
commit | c81199bab9f943e187ce8b1347bd06d2395674e6 (patch) | |
tree | 1fae31ed74ad2ca4ca0c649e8020210fc78625e1 | |
parent | e06ebbc33fae83c4817a39af15fa0784ac233459 (diff) | |
download | manaplus-c81199bab9f943e187ce8b1347bd06d2395674e6.tar.gz manaplus-c81199bab9f943e187ce8b1347bd06d2395674e6.tar.bz2 manaplus-c81199bab9f943e187ce8b1347bd06d2395674e6.tar.xz manaplus-c81199bab9f943e187ce8b1347bd06d2395674e6.zip |
in pethandler add pet id parameter.
-rw-r--r-- | src/being/being.cpp | 6 | ||||
-rw-r--r-- | src/commands.cpp | 3 | ||||
-rw-r--r-- | src/net/pethandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/pethandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/pethandler.h | 5 |
5 files changed, 15 insertions, 7 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 5c89ba579..6e5fa5e92 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1663,7 +1663,7 @@ void Being::petLogic() setAction(Being::STAND, 0); fixPetSpawnPos(dstX, dstY); setTileCoords(dstX, dstY); - Net::getPetHandler()->spawn(mOwner, dstX, dstY); + Net::getPetHandler()->spawn(mOwner, mId, dstX, dstY); } else if (!followDist || divX > followDist || divY > followDist) { @@ -1716,7 +1716,7 @@ void Being::petLogic() if (mX != dstX || mY != dstY) { setPath(mMap->findPath(mX, mY, dstX, dstY, walkMask)); - Net::getPetHandler()->move(mOwner, mX, mY, dstX, dstY); + Net::getPetHandler()->move(mOwner, mId, mX, mY, dstX, dstY); return; } } @@ -3232,7 +3232,7 @@ void Being::addPet(const int id) int dstY = mY; being->fixPetSpawnPos(dstX, dstY); being->setTileCoords(dstX, dstY); - Net::getPetHandler()->spawn(this, dstX, dstY); + Net::getPetHandler()->spawn(this, being->mId, dstX, dstY); } } diff --git a/src/commands.cpp b/src/commands.cpp index 10abd6d43..07e0414d5 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -726,7 +726,8 @@ impHandler1(emote) impHandler1(emotePet) { - Net::getPetHandler()->emote(static_cast<uint8_t>(atoi(args.c_str()))); + // need use actual pet id + Net::getPetHandler()->emote(static_cast<uint8_t>(atoi(args.c_str())), 0); } impHandler1(away) diff --git a/src/net/pethandler.h b/src/net/pethandler.h index 05816acc4..7b5666396 100644 --- a/src/net/pethandler.h +++ b/src/net/pethandler.h @@ -33,13 +33,15 @@ class PetHandler { } virtual void move(const Being *const being, + const int petId, const int x1, const int y1, const int x2, const int y2) const = 0; virtual void spawn(const Being *const being, + const int petId, const int x, const int y) const = 0; - virtual void emote(const uint8_t emoteId) const = 0; + virtual void emote(const uint8_t emoteId, const int petId) const = 0; }; } // namespace Net diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp index 2a3e56e0e..6b9e5adb7 100644 --- a/src/net/tmwa/pethandler.cpp +++ b/src/net/tmwa/pethandler.cpp @@ -52,17 +52,19 @@ void PetHandler::handleMessage(Net::MessageIn &msg A_UNUSED) } void PetHandler::move(const Being *const being A_UNUSED, + const int petId A_UNUSED, const int x1 A_UNUSED, const int y1 A_UNUSED, const int x2 A_UNUSED, const int y2 A_UNUSED) const { } void PetHandler::spawn(const Being *const being A_UNUSED, + const int petId A_UNUSED, const int x A_UNUSED, const int y A_UNUSED) const { } -void PetHandler::emote(const uint8_t emoteId) const +void PetHandler::emote(const uint8_t emoteId, const int petId A_UNUSED) const { Net::getChatHandler()->talk("\302\202\302e" + toString( static_cast<int>(emoteId)), GENERAL_CHANNEL); diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h index 81536e0b1..30eff59b8 100644 --- a/src/net/tmwa/pethandler.h +++ b/src/net/tmwa/pethandler.h @@ -38,13 +38,16 @@ class PetHandler final : public MessageHandler, public Net::PetHandler void handleMessage(Net::MessageIn &msg) override final; void move(const Being *const being, + const int petId, const int x1, const int y1, const int x2, const int y2) const override final; void spawn(const Being *const being, + const int petId, const int x, const int y) const override final; - void emote(const uint8_t emoteId) const override final; + void emote(const uint8_t emoteId, + const int petId) const override final; }; } // namespace TmwAthena |