Fix tamed horses despawning when player moves away (#1057)
Co-authored-by: MCbabel <MCbabel@users.noreply.github.com>
This commit is contained in:
@@ -515,6 +515,15 @@ bool EntityHorse::canSpawn()
|
|||||||
return Animal::canSpawn();
|
return Animal::canSpawn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EntityHorse::removeWhenFarAway()
|
||||||
|
{
|
||||||
|
if (isTamed()) return false;
|
||||||
|
if (isSaddled()) return false;
|
||||||
|
if (isLeashed()) return false;
|
||||||
|
if (getArmorType() > 0) return false;
|
||||||
|
return Animal::removeWhenFarAway();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
shared_ptr<EntityHorse> EntityHorse::getClosestMommy(shared_ptr<Entity> baby, double searchRadius)
|
shared_ptr<EntityHorse> EntityHorse::getClosestMommy(shared_ptr<Entity> baby, double searchRadius)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,6 +192,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
virtual void containerChanged();
|
virtual void containerChanged();
|
||||||
virtual bool canSpawn();
|
virtual bool canSpawn();
|
||||||
|
virtual bool removeWhenFarAway() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual shared_ptr<EntityHorse> getClosestMommy(shared_ptr<Entity> baby, double searchRadius);
|
virtual shared_ptr<EntityHorse> getClosestMommy(shared_ptr<Entity> baby, double searchRadius);
|
||||||
|
|||||||
Reference in New Issue
Block a user