summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/localplayer.cpp4
-rw-r--r--src/being/playerinfo.cpp8
-rw-r--r--src/being/playerinfo.h2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index a160896fb..819032af7 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -771,7 +771,9 @@ void LocalPlayer::attack(Being *const target, const bool keep,
if (!dontChangeEquipment)
changeEquipmentBeforeAttack(target);
- playerHandler->attack(target->getId(), mServerAttack);
+ const int targetId = target->getId();
+ playerHandler->attack(targetId, mServerAttack);
+ PlayerInfo::updateAttackAi(targetId, mServerAttack);
}
if (!keep)
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index d2749a9b1..07696b66c 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -553,4 +553,12 @@ void updateMoveAI()
homunculusHandler->moveToMaster();
}
+void updateAttackAi(const int targetId, const bool keep)
+{
+ if (mMercenary)
+ mercenaryHandler->attack(targetId, keep);
+ if (mHomunculus)
+ homunculusHandler->attack(targetId, keep);
+}
+
} // namespace PlayerInfo
diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h
index 784a3b8ea..c4ccfd4be 100644
--- a/src/being/playerinfo.h
+++ b/src/being/playerinfo.h
@@ -262,6 +262,8 @@ namespace PlayerInfo
int getMercenaryId();
void updateMoveAI();
+
+ void updateAttackAi(const int targetId, const bool keep);
} // namespace PlayerInfo
#endif // BEING_PLAYERINFO_H