summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index e93675e5a..bbf011a68 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -1337,8 +1337,6 @@ void Being::setDirection(const uint8_t direction)
if (mAnimationEffect)
mAnimationEffect->setSpriteDirection(dir);
recalcSpritesOrder();
- if (mPet)
- mPet->petLogic();
}
uint8_t Being::calcDirection() const
@@ -1633,6 +1631,14 @@ void Being::petLogic()
{
if (!mOwner || !mMap || !mInfo)
return;
+
+ const int time = tick_time;
+ const int thinkTime = mInfo->getThinkTime();
+ if (abs(mMoveTime - time) < thinkTime)
+ return;
+
+ mMoveTime = time;
+
const int dstX0 = mOwner->getTileX();
const int dstY0 = mOwner->getTileY();
int dstX = dstX0;
@@ -3190,12 +3196,6 @@ void Being::updatePets()
}
}
-void Being::updatePet()
-{
- if (mPet)
- mPet->petLogic();
-}
-
void Being::fixPetSpawnPos(int &dstX, int &dstY) const
{
if (!mInfo || !mOwner)