summaryrefslogtreecommitdiffstats
path: root/src/Mobs/PassiveMonster.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-11-23 23:57:59 +0100
committerworktycho <work.tycho@gmail.com>2015-11-23 23:57:59 +0100
commit2d408e864706a4dd8d7c227edefd281f6a627895 (patch)
tree5ebe9e808e82c22a427429881526fb0ce390deb4 /src/Mobs/PassiveMonster.cpp
parentFixed display of helpmessage (diff)
parentchange from single followable item to multiple (diff)
downloadcuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.gz
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.bz2
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.lz
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.xz
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.zst
cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/PassiveMonster.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Mobs/PassiveMonster.cpp b/src/Mobs/PassiveMonster.cpp
index c220a7128..a3d51da35 100644
--- a/src/Mobs/PassiveMonster.cpp
+++ b/src/Mobs/PassiveMonster.cpp
@@ -43,15 +43,17 @@ void cPassiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
CheckEventLostPlayer();
}
- cItem FollowedItem = GetFollowedItem();
- if (FollowedItem.IsEmpty())
+ cItems FollowedItems;
+ GetFollowedItems(FollowedItems);
+ if (FollowedItems.Size() <= 0)
{
return;
}
cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), static_cast<float>(m_SightDistance));
if (a_Closest_Player != nullptr)
{
- if (a_Closest_Player->GetEquippedItem().IsEqual(FollowedItem))
+ cItem EquippedItem = a_Closest_Player->GetEquippedItem();
+ if (FollowedItems.ContainsType(EquippedItem))
{
Vector3d PlayerPos = a_Closest_Player->GetPosition();
MoveToPosition(PlayerPos);