diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-02-22 15:00:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-02-22 15:00:14 +0300 |
commit | 752c00b3e14478ebfc243938ed0bfd3af0a05f58 (patch) | |
tree | 462cbce8889111c8be0906c5821a9c3212fc3a74 /src/actions/pets.cpp | |
parent | 7e44f48d83922efe4b2e5ff50813fef65c1877b1 (diff) | |
download | plus-752c00b3e14478ebfc243938ed0bfd3af0a05f58.tar.gz plus-752c00b3e14478ebfc243938ed0bfd3af0a05f58.tar.bz2 plus-752c00b3e14478ebfc243938ed0bfd3af0a05f58.tar.xz plus-752c00b3e14478ebfc243938ed0bfd3af0a05f58.zip |
eathena: add packet CMSG_PET_MOVE_TO 0x0b11.
Diffstat (limited to 'src/actions/pets.cpp')
-rw-r--r-- | src/actions/pets.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/actions/pets.cpp b/src/actions/pets.cpp index 2247e0533..2b3f6dfb8 100644 --- a/src/actions/pets.cpp +++ b/src/actions/pets.cpp @@ -124,7 +124,7 @@ impHandler0(petMoveUp) const Being *const pet = getPet(); if (!pet) return false; - petHandler->move(pet->getId(), pet->getTileX(), pet->getTileY() - 1); + petHandler->move(0, pet->getTileX(), pet->getTileY() - 1); return true; } @@ -133,7 +133,7 @@ impHandler0(petMoveDown) const Being *const pet = getPet(); if (!pet) return false; - petHandler->move(pet->getId(), pet->getTileX(), pet->getTileY() + 1); + petHandler->move(0, pet->getTileX(), pet->getTileY() + 1); return true; } @@ -142,7 +142,7 @@ impHandler0(petMoveLeft) const Being *const pet = getPet(); if (!pet) return false; - petHandler->move(pet->getId(), pet->getTileX() - 1, pet->getTileY()); + petHandler->move(0, pet->getTileX() - 1, pet->getTileY()); return true; } @@ -151,12 +151,15 @@ impHandler0(petMoveRight) const Being *const pet = getPet(); if (!pet) return false; - petHandler->move(pet->getId(), pet->getTileX() + 1, pet->getTileY()); + petHandler->move(0, pet->getTileX() + 1, pet->getTileY()); return true; } impHandler0(petDirectUp) { + const Being *const pet = getPet(); + if (!pet) + return false; petHandler->setDirection(BeingDirection::UP); return true; } @@ -193,16 +196,12 @@ impHandler0(petAiStop) impHandler0(petMove) { - const Being *const pet = getPet(); - if (!pet) - return false; - int x = 0; int y = 0; if (parse2Int(event.args, x, y)) { - petHandler->move(pet->getId(), x, y); + petHandler->move(0, x, y); return true; } return false; |