summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp16
-rw-r--r--src/being/being.h2
2 files changed, 8 insertions, 10 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)
diff --git a/src/being/being.h b/src/being/being.h
index 99e9dda45..e8bc7da37 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -881,8 +881,6 @@ class Being : public ActorSprite, public ConfigListener
void updatePets();
- void updatePet();
-
void fixPetSpawnPos(int &dstX, int &dstY) const;
Being *getPet()