Skip to content

Commit

Permalink
Override Player::removeAttackedCreature
Browse files Browse the repository at this point in the history
  • Loading branch information
ramon-bernardo committed Nov 5, 2024
1 parent dc2b817 commit 14da3bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3354,6 +3354,15 @@ void Player::setAttackedCreature(Creature* creature)
g_dispatcher.addTask([id = getID()]() { g_game.checkCreatureAttack(id); });
}

void Player::removeAttackedCreature()
{
Creature::removeAttackedCreature();

if (followCreature) {
setFollowCreature(nullptr);
}
}

void Player::goToFollowCreature()
{
if (!walkTask) {
Expand Down
1 change: 1 addition & 0 deletions src/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ class Player final : public Creature, public Cylinder

// combat functions
void setAttackedCreature(Creature* creature) override;
void removeAttackedCreature() override;
bool isImmune(CombatType_t type) const override;
bool isImmune(ConditionType_t type) const override;
bool hasShield() const;
Expand Down

0 comments on commit 14da3bc

Please sign in to comment.