summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Mobs/Chicken.cpp12
-rw-r--r--src/Mobs/Chicken.h2
-rw-r--r--src/Mobs/Ocelot.cpp10
-rw-r--r--src/Mobs/Ocelot.h1
4 files changed, 19 insertions, 6 deletions
diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp
index e2caa6f67..242fe5aa0 100644
--- a/src/Mobs/Chicken.cpp
+++ b/src/Mobs/Chicken.cpp
@@ -74,10 +74,12 @@ void cChicken::GetDrops(cItems & a_Drops, cEntity * a_Killer)
-void cChicken::HandleFalling(void)
+bool cChicken::DoTakeDamage(TakeDamageInfo & a_TDI)
{
- // empty - chickens don't take fall damage
-}
-
-
+ if (a_TDI.DamageType == dtFalling)
+ {
+ return false;
+ }
+ return super::DoTakeDamage(a_TDI);
+}
diff --git a/src/Mobs/Chicken.h b/src/Mobs/Chicken.h
index 0dfc5e3d6..bb12ce9b3 100644
--- a/src/Mobs/Chicken.h
+++ b/src/Mobs/Chicken.h
@@ -27,7 +27,7 @@ public:
a_Items.Add(E_ITEM_SEEDS);
}
- virtual void HandleFalling(void) override;
+ virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
private:
diff --git a/src/Mobs/Ocelot.cpp b/src/Mobs/Ocelot.cpp
index 50dd249c0..5e94cacb9 100644
--- a/src/Mobs/Ocelot.cpp
+++ b/src/Mobs/Ocelot.cpp
@@ -218,3 +218,13 @@ bool cOcelot::IsCatSittingOnBlock(cWorld * a_World, Vector3d a_BlockPosition)
+
+bool cOcelot::DoTakeDamage(TakeDamageInfo & a_TDI)
+{
+ if (a_TDI.DamageType == dtFalling)
+ {
+ return false;
+ }
+
+ return super::DoTakeDamage(a_TDI);
+}
diff --git a/src/Mobs/Ocelot.h b/src/Mobs/Ocelot.h
index 75758a973..b8efc60ee 100644
--- a/src/Mobs/Ocelot.h
+++ b/src/Mobs/Ocelot.h
@@ -35,6 +35,7 @@ public:
{
a_Items.Add(E_ITEM_RAW_FISH);
}
+ virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
// Get functions
bool IsSitting (void) const override { return m_IsSitting; }