diff options
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/AggressiveMonster.cpp | 2 | ||||
-rw-r--r-- | src/Mobs/Chicken.cpp | 4 | ||||
-rw-r--r-- | src/Mobs/Chicken.h | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp index 65bda2dff..1355a3627 100644 --- a/src/Mobs/AggressiveMonster.cpp +++ b/src/Mobs/AggressiveMonster.cpp @@ -80,7 +80,7 @@ void cAggressiveMonster::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) Vector3d AttackDirection(m_Target->GetPosition() + Vector3d(0, m_Target->GetHeight(), 0) - MyHeadPosition); - if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length()))) + if (TargetIsInRange() && !LineOfSight.Trace(MyHeadPosition, AttackDirection, static_cast<int>(AttackDirection.Length())) && (GetHealth() > 0.0)) { // Attack if reached destination, target isn't null, and have a clear line of sight to target (so won't attack through walls) StopMovingToPosition(); diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp index a52d1a2da..71f401e6e 100644 --- a/src/Mobs/Chicken.cpp +++ b/src/Mobs/Chicken.cpp @@ -61,6 +61,10 @@ void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer) +void cChicken::HandleFalling(void) +{ + // empty - chickens don't take fall damage +} diff --git a/src/Mobs/Chicken.h b/src/Mobs/Chicken.h index 9349187c6..05cf0ed39 100644 --- a/src/Mobs/Chicken.h +++ b/src/Mobs/Chicken.h @@ -21,6 +21,8 @@ public: virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_SEEDS); } + virtual void HandleFalling(void) override; + private: int m_EggDropTimer; |