summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-19 23:35:35 +0200
committerarchshift <admin@archshift.com>2014-07-19 23:35:35 +0200
commitada88a58053e74c910982f7c3ebdfb791161c110 (patch)
tree6c149d997da76c0b2305c10bf8815b5eaab1563a
parentCheckBasicStyle: Checks for braces not on separate lines. (diff)
downloadcuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar.gz
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar.bz2
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar.lz
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar.xz
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.tar.zst
cuberite-ada88a58053e74c910982f7c3ebdfb791161c110.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp10
-rw-r--r--src/Mobs/Monster.h2
-rw-r--r--src/Mobs/Skeleton.h2
-rw-r--r--src/Mobs/Wither.h2
-rw-r--r--src/Mobs/Zombie.h6
-rw-r--r--src/Mobs/ZombiePigman.h2
6 files changed, 11 insertions, 13 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index db45db5b9..753a44914 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -680,16 +680,6 @@ void cMonster::GetMonsterConfig(const AString & a_Name)
bool cMonster::IsUndead(void)
{
- switch (GetMobType())
- {
- case mtZombie:
- case mtZombiePigman:
- case mtSkeleton:
- case mtWither:
- {
- return true;
- }
- }
return false;
}
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index bbc3ebd35..ffd078505 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -107,7 +107,7 @@ public:
void GetMonsterConfig(const AString & a_Name);
/** Returns whether this mob is undead (skeleton, zombie, etc.) */
- bool IsUndead(void);
+ virtual bool IsUndead(void);
virtual void EventLosePlayer(void);
virtual void CheckEventLostPlayer(void);
diff --git a/src/Mobs/Skeleton.h b/src/Mobs/Skeleton.h
index efb670c83..9a121ef48 100644
--- a/src/Mobs/Skeleton.h
+++ b/src/Mobs/Skeleton.h
@@ -22,6 +22,8 @@ public:
virtual void Attack(float a_Dt) override;
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
+ virtual bool IsUndead(void) override { return true; }
+
bool IsWither(void) const { return m_bIsWither; };
private:
diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h
index 7d76f70f5..cc8d1459b 100644
--- a/src/Mobs/Wither.h
+++ b/src/Mobs/Wither.h
@@ -30,6 +30,8 @@ public:
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
+
+ virtual bool IsUndead(void) override { return true; }
private:
diff --git a/src/Mobs/Zombie.h b/src/Mobs/Zombie.h
index c56409570..082573d8b 100644
--- a/src/Mobs/Zombie.h
+++ b/src/Mobs/Zombie.h
@@ -19,8 +19,10 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3d & a_Position) override;
- bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
- bool IsConverting (void) const {return m_IsConverting; }
+ virtual bool IsUndead(void) override { return true; }
+
+ bool IsVillagerZombie(void) const { return m_IsVillagerZombie; }
+ bool IsConverting (void) const { return m_IsConverting; }
private:
diff --git a/src/Mobs/ZombiePigman.h b/src/Mobs/ZombiePigman.h
index a2ebc87cb..a4bad7efb 100644
--- a/src/Mobs/ZombiePigman.h
+++ b/src/Mobs/ZombiePigman.h
@@ -18,6 +18,8 @@ public:
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void KilledBy(TakeDamageInfo & a_TDI) override;
+
+ virtual bool IsUndead(void) override { return true; }
} ;