From 52d4c49d5cd2c15078c84a18821761b723833584 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 17 Jul 2014 22:32:23 +0200 Subject: Fixed many slime bugs. - Fixed slime hurt/death sound - Added slime spawning on death. - Fixed the max health. - Fixed the attack damage. - Little slimes should not attack players. --- src/Mobs/Slime.cpp | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++- src/Mobs/Slime.h | 8 +++++-- 2 files changed, 73 insertions(+), 3 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 52a52bb39..d74b66e5b 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -2,6 +2,8 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Slime.h" +#include "FastRandom.h" +#include "World.h" @@ -9,9 +11,11 @@ /// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest cSlime::cSlime(int a_Size) : - super("Slime", mtSlime, "mob.slime.attack", "mob.slime.attack", 0.6 * a_Size, 0.6 * a_Size), + super("Slime", mtSlime, Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), 0.6 * a_Size, 0.6 * a_Size), m_Size(a_Size) { + SetMaxHealth(a_Size * a_Size); + SetAttackDamage(a_Size); } @@ -25,6 +29,7 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) { LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } + if (GetSize() == 1) { AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SLIMEBALL); @@ -34,3 +39,64 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) + +void cSlime::Attack(float a_Dt) +{ + if (m_Size != 1) + { + // Only slimes with the size 2 and 3 attacks a player. + super::Attack(a_Dt); + } +} + + + + + +void cSlime::KilledBy(TakeDamageInfo & a_TDI) +{ + if (GetHealth() > 0) + { + return; + } + + if (m_Size != 1) + { + cFastRandom Random; + int SpawnAmount = 2 + Random.NextInt(3); + + for (int i = 0; i < SpawnAmount; ++i) + { + double AddX = (i % 2 - 0.5) * m_Size / 4.0; + double AddZ = (i / 2 - 0.5) * m_Size / 4.0; + + cSlime * NewSlime = new cSlime(m_Size / 2); + NewSlime->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ); + NewSlime->SetYaw(Random.NextFloat(2.0f) * 360.0f); + NewSlime->SetPitch(0.0f); + + m_World->SpawnMobFinalize(NewSlime); + } + } + super::KilledBy(a_TDI); +} + + + + + +const AString & cSlime::GetSizeName(int a_Size) +{ + if (a_Size > 1) + { + return "big"; + } + else + { + return "small"; + } +} + + + + diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index 782c3113f..1f66d9afb 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -13,17 +13,21 @@ class cSlime : typedef cAggressiveMonster super; public: - /// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest + /** Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest */ cSlime(int a_Size); CLASS_PROTODEF(cSlime); virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; + virtual void Attack(float a_Dt) override; + virtual void KilledBy(TakeDamageInfo & a_TDI) override; + int GetSize(void) const { return m_Size; } + const AString & GetSizeName(int a_Size); protected: - /// Size of the slime, 1 .. 3, with 1 being the smallest + /** Size of the slime, 1 .. 3, with 1 being the smallest */ int m_Size; } ; -- cgit v1.2.3 From fba93aac2aa90fa654fef9fe4252042aae53893f Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 17 Jul 2014 23:32:01 +0200 Subject: Split into more lines. --- src/Mobs/Slime.cpp | 14 +++++++++----- src/Mobs/Slime.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index d74b66e5b..4e12fca51 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -11,7 +11,13 @@ /// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest cSlime::cSlime(int a_Size) : - super("Slime", mtSlime, Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), 0.6 * a_Size, 0.6 * a_Size), + super("Slime", + mtSlime, + Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), + Printf("mob.slime.%s", GetSizeName(a_Size).c_str()), + 0.6 * a_Size, + 0.6 * a_Size + ), m_Size(a_Size) { SetMaxHealth(a_Size * a_Size); @@ -72,9 +78,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI) cSlime * NewSlime = new cSlime(m_Size / 2); NewSlime->SetPosition(GetPosX() + AddX, GetPosY() + 0.5, GetPosZ() + AddZ); - NewSlime->SetYaw(Random.NextFloat(2.0f) * 360.0f); - NewSlime->SetPitch(0.0f); - + NewSlime->SetYaw(Random.NextFloat(1.0f) * 360.0f); m_World->SpawnMobFinalize(NewSlime); } } @@ -85,7 +89,7 @@ void cSlime::KilledBy(TakeDamageInfo & a_TDI) -const AString & cSlime::GetSizeName(int a_Size) +const AString cSlime::GetSizeName(int a_Size) const { if (a_Size > 1) { diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index 1f66d9afb..87c5a8e5e 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -23,7 +23,7 @@ public: virtual void KilledBy(TakeDamageInfo & a_TDI) override; int GetSize(void) const { return m_Size; } - const AString & GetSizeName(int a_Size); + const AString GetSizeName(int a_Size) const; protected: -- cgit v1.2.3 From 33bd78dcdd1f080ef5d3b47b0e24099227a8a5d5 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 18 Jul 2014 01:26:27 +0200 Subject: Skeletons should spawn with a bow in the hand. Fixes #1184 --- src/Mobs/Skeleton.cpp | 15 +++++++++++++++ src/Mobs/Skeleton.h | 2 ++ 2 files changed, 17 insertions(+) (limited to 'src/Mobs') diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 0641a3d57..2f57bedeb 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -4,6 +4,7 @@ #include "Skeleton.h" #include "../World.h" #include "../Entities/ArrowEntity.h" +#include "ClientHandle.h" @@ -90,3 +91,17 @@ void cSkeleton::Attack(float a_Dt) m_AttackInterval = 0.0; } } + + + + + +void cSkeleton::SpawnOn(cClientHandle & a_ClientHandle) +{ + super::SpawnOn(a_ClientHandle); + a_ClientHandle.SendEntityEquipment(*this, 0, cItem(E_ITEM_BOW)); +} + + + + diff --git a/src/Mobs/Skeleton.h b/src/Mobs/Skeleton.h index 8f31b42e1..229462d63 100644 --- a/src/Mobs/Skeleton.h +++ b/src/Mobs/Skeleton.h @@ -20,6 +20,8 @@ public: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void MoveToPosition(const Vector3f & a_Position) override; virtual void Attack(float a_Dt) override; + virtual void SpawnOn(cClientHandle & a_ClientHandle) override; + bool IsWither(void) const { return m_bIsWither; }; private: -- cgit v1.2.3 From 2df5e26d3b7f08ef7d120511705fa0b75a44783e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 09:57:34 +0200 Subject: Fixed spaces before commas. --- src/Mobs/Monster.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 750040468..6e14e3b18 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -76,9 +76,9 @@ public: enum MPersonality{PASSIVE,AGGRESSIVE,COWARDLY} m_EMPersonality; /** Creates the mob object. - * If a_ConfigName is not empty, the configuration is loaded using GetMonsterConfig() - * a_MobType is the type of the mob (also used in the protocol ( http://wiki.vg/Entities#Mobs , 2012_12_22)) - * a_SoundHurt and a_SoundDeath are assigned into m_SoundHurt and m_SoundDeath, respectively + If a_ConfigName is not empty, the configuration is loaded using GetMonsterConfig() + a_MobType is the type of the mob (also used in the protocol ( http://wiki.vg/Entities#Mobs 2012_12_22)) + a_SoundHurt and a_SoundDeath are assigned into m_SoundHurt and m_SoundDeath, respectively */ cMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); -- cgit v1.2.3 From f1be1eb6743700515de3a522898ba99680cf24c0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 18 Jul 2014 10:47:00 +0100 Subject: Monster fixes * Fixes #1203 * Fixes #627 --- src/Mobs/Monster.cpp | 27 +-------------------------- src/Mobs/Monster.h | 1 - src/Mobs/Skeleton.cpp | 2 +- src/Mobs/Skeleton.h | 2 +- src/Mobs/Zombie.cpp | 2 +- src/Mobs/Zombie.h | 2 +- 6 files changed, 5 insertions(+), 31 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index ba901df4e..1369746df 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -115,8 +115,6 @@ void cMonster::TickPathFinding() const int PosY = POSY_TOINT; const int PosZ = POSZ_TOINT; - m_FinalDestination.y = (double)FindFirstNonAirBlockPosition(m_FinalDestination.x, m_FinalDestination.z); - std::vector m_PotentialCoordinates; m_TraversedCoordinates.push_back(Vector3i(PosX, PosY, PosZ)); @@ -201,19 +199,6 @@ void cMonster::TickPathFinding() -void cMonster::MoveToPosition(const Vector3f & a_Position) -{ - FinishPathFinding(); - - m_FinalDestination = a_Position; - m_bMovingToDestination = true; - TickPathFinding(); -} - - - - - void cMonster::MoveToPosition(const Vector3d & a_Position) { FinishPathFinding(); @@ -227,15 +212,7 @@ void cMonster::MoveToPosition(const Vector3d & a_Position) bool cMonster::IsCoordinateInTraversedList(Vector3i a_Coords) { - for (std::vector::const_iterator itr = m_TraversedCoordinates.begin(); itr != m_TraversedCoordinates.end(); ++itr) - { - if (itr->Equals(a_Coords)) - { - return true; - } - } - - return false; + return (std::find(m_TraversedCoordinates.begin(), m_TraversedCoordinates.end(), a_Coords) != m_TraversedCoordinates.end()); } @@ -296,8 +273,6 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) { if (m_bOnGround) { - m_Destination.y = FindFirstNonAirBlockPosition(m_Destination.x, m_Destination.z); - if (DoesPosYRequireJump((int)floor(m_Destination.y))) { m_bOnGround = false; diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 6e14e3b18..4af7cf4f1 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -92,7 +92,6 @@ public: virtual void KilledBy(TakeDamageInfo & a_TDI) override; - virtual void MoveToPosition(const Vector3f & a_Position); virtual void MoveToPosition(const Vector3d & a_Position); // tolua_export virtual bool ReachedDestination(void); diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp index 2f57bedeb..cd707f4bb 100644 --- a/src/Mobs/Skeleton.cpp +++ b/src/Mobs/Skeleton.cpp @@ -48,7 +48,7 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer) -void cSkeleton::MoveToPosition(const Vector3f & a_Position) +void cSkeleton::MoveToPosition(const Vector3d & a_Position) { // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement if ( diff --git a/src/Mobs/Skeleton.h b/src/Mobs/Skeleton.h index 229462d63..efb670c83 100644 --- a/src/Mobs/Skeleton.h +++ b/src/Mobs/Skeleton.h @@ -18,7 +18,7 @@ public: CLASS_PROTODEF(cSkeleton); virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; - virtual void MoveToPosition(const Vector3f & a_Position) override; + virtual void MoveToPosition(const Vector3d & a_Position) override; virtual void Attack(float a_Dt) override; virtual void SpawnOn(cClientHandle & a_ClientHandle) override; diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp index 725790ed9..30225c32d 100644 --- a/src/Mobs/Zombie.cpp +++ b/src/Mobs/Zombie.cpp @@ -42,7 +42,7 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer) -void cZombie::MoveToPosition(const Vector3f & a_Position) +void cZombie::MoveToPosition(const Vector3d & a_Position) { // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement if ( diff --git a/src/Mobs/Zombie.h b/src/Mobs/Zombie.h index 1ba368f9c..c56409570 100644 --- a/src/Mobs/Zombie.h +++ b/src/Mobs/Zombie.h @@ -17,7 +17,7 @@ public: CLASS_PROTODEF(cZombie); virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; - virtual void MoveToPosition(const Vector3f & a_Position) override; + virtual void MoveToPosition(const Vector3d & a_Position) override; bool IsVillagerZombie(void) const {return m_IsVillagerZombie; } bool IsConverting (void) const {return m_IsConverting; } -- cgit v1.2.3 From 509d3d3b62c2dc5b328cf122c0fc5f0595b73721 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 18 Jul 2014 16:55:28 +0200 Subject: Slime sizes are 1, 2 or 4 and not 1, 2 or 3. --- src/Mobs/Monster.cpp | 2 +- src/Mobs/Slime.cpp | 4 ++-- src/Mobs/Slime.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e36634c73..2a796e8eb 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,7 +867,7 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(Random.NextInt(2) + 1); + toReturn = new cSlime(1 << Random.NextInt(3)); break; } case mtSkeleton: diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 4e12fca51..4b123df12 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -9,7 +9,6 @@ -/// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest cSlime::cSlime(int a_Size) : super("Slime", mtSlime, @@ -36,7 +35,8 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } - if (GetSize() == 1) + // Only slimes with the size 1 can drop slimeballs. + if (m_Size == 1) { AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SLIMEBALL); } diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index 87c5a8e5e..b0e2f627c 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -13,7 +13,7 @@ class cSlime : typedef cAggressiveMonster super; public: - /** Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest */ + /** Creates a slime of the specified size; size can be 1, 2 or 4, with 1 is the smallest and 4 is the tallest. */ cSlime(int a_Size); CLASS_PROTODEF(cSlime); -- cgit v1.2.3 From 19d012c96ec13498d97d8e43136cc09eca3dca2e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 23:20:42 +0200 Subject: Fixed slime-related comments. --- src/Mobs/Monster.cpp | 4 ++-- src/Mobs/Slime.cpp | 4 ++-- src/Mobs/Slime.h | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 2a796e8eb..19851e064 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,13 +867,13 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(1 << Random.NextInt(3)); + toReturn = new cSlime(1 << Random.NextInt(3)); // Size 1, 2 or 4 break; } case mtSkeleton: { // TODO: Actual detection of spawning in Nether - toReturn = new cSkeleton(Random.NextInt(1) == 0 ? false : true); + toReturn = new cSkeleton((Random.NextInt(1) == 0) ? false : true); break; } case mtVillager: diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 4b123df12..b709ec664 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -48,9 +48,9 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cSlime::Attack(float a_Dt) { - if (m_Size != 1) + if (m_Size > 1) { - // Only slimes with the size 2 and 3 attacks a player. + // Only slimes larger than size 1 attack a player. super::Attack(a_Dt); } } diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index b0e2f627c..15ae113dc 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -18,16 +18,21 @@ public: CLASS_PROTODEF(cSlime); + // cAggressiveMonster overrides: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Attack(float a_Dt) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override; int GetSize(void) const { return m_Size; } + + /** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds. + Returns either "big" or "small". */ const AString GetSizeName(int a_Size) const; protected: - /** Size of the slime, 1 .. 3, with 1 being the smallest */ + /** Size of the slime, with 1 being the smallest. + Vanilla uses sizes 1, 2 and 4 only. */ int m_Size; } ; -- cgit v1.2.3 From 2f811fc6a2cf2ddacdcb443049a44ad6481f135a Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 17 Jul 2014 23:55:34 -0700 Subject: Mobs/CMakeLists.txt: Replaced glob with list of files --- src/Mobs/CMakeLists.txt | 74 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 5 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/CMakeLists.txt b/src/Mobs/CMakeLists.txt index 53c265803..d73a7aafd 100644 --- a/src/Mobs/CMakeLists.txt +++ b/src/Mobs/CMakeLists.txt @@ -4,9 +4,73 @@ project (MCServer) include_directories ("${PROJECT_SOURCE_DIR}/../") -file(GLOB SOURCE - "*.cpp" - "*.h" -) +SET (SRCS + AggressiveMonster.cpp + Bat.cpp + Blaze.cpp + CaveSpider.cpp + Chicken.cpp + Cow.cpp + Creeper.cpp + EnderDragon.cpp + Enderman.cpp + Ghast.cpp + Giant.cpp + Horse.cpp + IronGolem.cpp + MagmaCube.cpp + Monster.cpp + Mooshroom.cpp + PassiveAggressiveMonster.cpp + PassiveMonster.cpp + Pig.cpp + Sheep.cpp + Skeleton.cpp + Slime.cpp + SnowGolem.cpp + Spider.cpp + Squid.cpp + Villager.cpp + Witch.cpp + Wither.cpp + Wolf.cpp + Zombie.cpp + ZombiePigman.cpp) + +SET (HDRS + AggressiveMonster.h + Bat.h + Blaze.h + CaveSpider.h + Chicken.h + Cow.h + Creeper.h + EnderDragon.h + Enderman.h + Ghast.h + Giant.h + Horse.h + IncludeAllMonsters.h + IronGolem.h + MagmaCube.h + Monster.h + Mooshroom.h + Ocelot.h + PassiveAggressiveMonster.h + PassiveMonster.h + Pig.h + Sheep.h + Silverfish.h + Skeleton.h + Slime.h + SnowGolem.h + Spider.h + Squid.h + Villager.h + Witch.h + Wither.h + Wolf.h + Zombie.h + ZombiePigman.h) -add_library(Mobs ${SOURCE}) +add_library(Mobs ${SRCS} ${HDRS}) -- cgit v1.2.3 From 725d1fd1e2995b1720673c280fea1125ac338b3c Mon Sep 17 00:00:00 2001 From: archshift Date: Fri, 18 Jul 2014 13:26:43 -0700 Subject: Subdirs: Only add_library if not using MSVC --- src/Mobs/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Mobs') diff --git a/src/Mobs/CMakeLists.txt b/src/Mobs/CMakeLists.txt index d73a7aafd..2c092c15f 100644 --- a/src/Mobs/CMakeLists.txt +++ b/src/Mobs/CMakeLists.txt @@ -73,4 +73,6 @@ SET (HDRS Zombie.h ZombiePigman.h) -add_library(Mobs ${SRCS} ${HDRS}) +if(NOT MSVC) + add_library(Mobs ${SRCS} ${HDRS}) +endif() -- cgit v1.2.3 From 041bfd5860cd8ef51db42eb6fb4b50b45549feba Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 01:40:29 -0700 Subject: Fixed clamping issues --- src/Mobs/Monster.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e6c82a448..8d612fbaa 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -414,11 +414,7 @@ void cMonster::HandleFalling() int cMonster::FindFirstNonAirBlockPosition(double a_PosX, double a_PosZ) { int PosY = POSY_TOINT; - - if (PosY < 0) - PosY = 0; - else if (PosY > cChunkDef::Height) - PosY = cChunkDef::Height; + PosY = Clamp(PosY, 0, cChunkDef::Height); if (!cBlockInfo::IsSolid(m_World->GetBlock((int)floor(a_PosX), PosY, (int)floor(a_PosZ)))) { -- cgit v1.2.3 From 00c524519ef6c7ceaf4ac91307617cfd65d7cf21 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 14:53:41 +0200 Subject: Fixed style: spaces after commas. --- src/Mobs/Monster.cpp | 2 +- src/Mobs/Monster.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 8d612fbaa..db45db5b9 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -126,7 +126,7 @@ void cMonster::TickPathFinding() { 1, 0}, {-1, 0}, { 0, 1}, - { 0,-1}, + { 0, -1}, } ; if ((PosY - 1 < 0) || (PosY + 2 > cChunkDef::Height) /* PosY + 1 will never be true if PosY + 2 is not */) diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 4af7cf4f1..bbc3ebd35 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -73,7 +73,7 @@ public: // tolua_end enum MState{ATTACKING, IDLE, CHASING, ESCAPING} m_EMState; - enum MPersonality{PASSIVE,AGGRESSIVE,COWARDLY} m_EMPersonality; + enum MPersonality{PASSIVE, AGGRESSIVE, COWARDLY} m_EMPersonality; /** Creates the mob object. If a_ConfigName is not empty, the configuration is loaded using GetMonsterConfig() -- cgit v1.2.3 From ada88a58053e74c910982f7c3ebdfb791161c110 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 14:35:35 -0700 Subject: Monsters: Made IsUndead overridable by the respective mob classes --- src/Mobs/Monster.cpp | 10 ---------- src/Mobs/Monster.h | 2 +- src/Mobs/Skeleton.h | 2 ++ src/Mobs/Wither.h | 2 ++ src/Mobs/Zombie.h | 6 ++++-- src/Mobs/ZombiePigman.h | 2 ++ 6 files changed, 11 insertions(+), 13 deletions(-) (limited to 'src/Mobs') 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; } } ; -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Mobs/Monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 753a44914..c1247c1f8 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -281,7 +281,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) } Vector3f Distance = m_Destination - GetPosition(); - if(!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move + if (!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move { Distance.y = 0; Distance.Normalize(); -- cgit v1.2.3 From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/Mobs/SnowGolem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs') diff --git a/src/Mobs/SnowGolem.cpp b/src/Mobs/SnowGolem.cpp index c1979a495..76334d970 100644 --- a/src/Mobs/SnowGolem.cpp +++ b/src/Mobs/SnowGolem.cpp @@ -30,7 +30,7 @@ void cSnowGolem::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cSnowGolem::Tick(float a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); - if (IsBiomeNoDownfall(m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ())) )) + if (IsBiomeNoDownfall(m_World->GetBiomeAt((int) floor(GetPosX()), (int) floor(GetPosZ())))) { TakeDamage(*this); } -- cgit v1.2.3 From 4191be7ddba820af4ed0c505a8d62416c2b7a8b4 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 22 Jul 2014 15:36:13 -0700 Subject: Removed redundant semicolons and re-added warning --- src/Mobs/Bat.h | 2 +- src/Mobs/Blaze.h | 2 +- src/Mobs/CaveSpider.h | 2 +- src/Mobs/Chicken.h | 2 +- src/Mobs/Cow.h | 2 +- src/Mobs/Creeper.h | 2 +- src/Mobs/EnderDragon.h | 2 +- src/Mobs/Enderman.h | 2 +- src/Mobs/Ghast.h | 2 +- src/Mobs/Giant.h | 2 +- src/Mobs/Horse.h | 2 +- src/Mobs/IronGolem.h | 2 +- src/Mobs/MagmaCube.h | 2 +- src/Mobs/Monster.h | 2 +- src/Mobs/Mooshroom.h | 2 +- src/Mobs/Ocelot.h | 2 +- src/Mobs/Pig.h | 2 +- src/Mobs/Sheep.h | 2 +- src/Mobs/Silverfish.h | 2 +- src/Mobs/Skeleton.h | 4 ++-- src/Mobs/Slime.h | 2 +- src/Mobs/SnowGolem.h | 2 +- src/Mobs/Spider.h | 2 +- src/Mobs/Squid.h | 2 +- src/Mobs/Villager.h | 2 +- src/Mobs/Witch.h | 2 +- src/Mobs/Wither.h | 2 +- src/Mobs/Wolf.h | 2 +- src/Mobs/Zombie.h | 2 +- src/Mobs/ZombiePigman.h | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/Mobs') diff --git a/src/Mobs/Bat.h b/src/Mobs/Bat.h index e878d0ee8..6b06aeb4f 100644 --- a/src/Mobs/Bat.h +++ b/src/Mobs/Bat.h @@ -15,7 +15,7 @@ class cBat : public: cBat(void); - CLASS_PROTODEF(cBat); + CLASS_PROTODEF(cBat) bool IsHanging(void) const {return false; } } ; diff --git a/src/Mobs/Blaze.h b/src/Mobs/Blaze.h index 5970451c7..f283b1070 100644 --- a/src/Mobs/Blaze.h +++ b/src/Mobs/Blaze.h @@ -15,7 +15,7 @@ class cBlaze : public: cBlaze(void); - CLASS_PROTODEF(cBlaze); + CLASS_PROTODEF(cBlaze) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Attack(float a_Dt) override; diff --git a/src/Mobs/CaveSpider.h b/src/Mobs/CaveSpider.h index 3f8b2cece..f9ed10e1b 100644 --- a/src/Mobs/CaveSpider.h +++ b/src/Mobs/CaveSpider.h @@ -14,7 +14,7 @@ class cCaveSpider : public: cCaveSpider(void); - CLASS_PROTODEF(cCaveSpider); + CLASS_PROTODEF(cCaveSpider) virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual void Attack(float a_Dt) override; diff --git a/src/Mobs/Chicken.h b/src/Mobs/Chicken.h index a4c1d6b9e..b1a50b61c 100644 --- a/src/Mobs/Chicken.h +++ b/src/Mobs/Chicken.h @@ -14,7 +14,7 @@ class cChicken : public: cChicken(void); - CLASS_PROTODEF(cChicken); + CLASS_PROTODEF(cChicken) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; diff --git a/src/Mobs/Cow.h b/src/Mobs/Cow.h index 973171ab5..8814b7e09 100644 --- a/src/Mobs/Cow.h +++ b/src/Mobs/Cow.h @@ -15,7 +15,7 @@ class cCow : public: cCow(); - CLASS_PROTODEF(cCow); + CLASS_PROTODEF(cCow) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; diff --git a/src/Mobs/Creeper.h b/src/Mobs/Creeper.h index fc7db6716..747daca09 100644 --- a/src/Mobs/Creeper.h +++ b/src/Mobs/Creeper.h @@ -15,7 +15,7 @@ class cCreeper : public: cCreeper(void); - CLASS_PROTODEF(cCreeper); + CLASS_PROTODEF(cCreeper) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; diff --git a/src/Mobs/EnderDragon.h b/src/Mobs/EnderDragon.h index 77177edfe..1d4cd657c 100644 --- a/src/Mobs/EnderDragon.h +++ b/src/Mobs/EnderDragon.h @@ -15,7 +15,7 @@ class cEnderDragon : public: cEnderDragon(void); - CLASS_PROTODEF(cEnderDragon); + CLASS_PROTODEF(cEnderDragon) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/src/Mobs/Enderman.h b/src/Mobs/Enderman.h index 32e40e70b..aa2eff682 100644 --- a/src/Mobs/Enderman.h +++ b/src/Mobs/Enderman.h @@ -15,7 +15,7 @@ class cEnderman : public: cEnderman(void); - CLASS_PROTODEF(cEnderman); + CLASS_PROTODEF(cEnderman) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/Ghast.h b/src/Mobs/Ghast.h index 43e8bedb6..1d4e6b94a 100644 --- a/src/Mobs/Ghast.h +++ b/src/Mobs/Ghast.h @@ -15,7 +15,7 @@ class cGhast : public: cGhast(void); - CLASS_PROTODEF(cGhast); + CLASS_PROTODEF(cGhast) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Attack(float a_Dt) override; diff --git a/src/Mobs/Giant.h b/src/Mobs/Giant.h index 356dd4352..7c04c9b4f 100644 --- a/src/Mobs/Giant.h +++ b/src/Mobs/Giant.h @@ -15,7 +15,7 @@ class cGiant : public: cGiant(void); - CLASS_PROTODEF(cGiant); + CLASS_PROTODEF(cGiant) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/src/Mobs/Horse.h b/src/Mobs/Horse.h index be0c23f9b..47189b3b0 100644 --- a/src/Mobs/Horse.h +++ b/src/Mobs/Horse.h @@ -15,7 +15,7 @@ class cHorse : public: cHorse(int Type, int Color, int Style, int TameTimes); - CLASS_PROTODEF(cHorse); + CLASS_PROTODEF(cHorse) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override; diff --git a/src/Mobs/IronGolem.h b/src/Mobs/IronGolem.h index 30f9bedff..c5341ed76 100644 --- a/src/Mobs/IronGolem.h +++ b/src/Mobs/IronGolem.h @@ -15,7 +15,7 @@ class cIronGolem : public: cIronGolem(void); - CLASS_PROTODEF(cIronGolem); + CLASS_PROTODEF(cIronGolem) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/MagmaCube.h b/src/Mobs/MagmaCube.h index 43065cae5..bfe63fa2e 100644 --- a/src/Mobs/MagmaCube.h +++ b/src/Mobs/MagmaCube.h @@ -15,7 +15,7 @@ public: /// Creates a MagmaCube of the specified size; size is 1 .. 3, with 1 being the smallest cMagmaCube(int a_Size); - CLASS_PROTODEF(cMagmaCube); + CLASS_PROTODEF(cMagmaCube) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; int GetSize(void) const { return m_Size; } diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index ffd078505..cdbd26c09 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -82,7 +82,7 @@ public: */ cMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); - CLASS_PROTODEF(cMonster); + CLASS_PROTODEF(cMonster) virtual void SpawnOn(cClientHandle & a_ClientHandle) override; diff --git a/src/Mobs/Mooshroom.h b/src/Mobs/Mooshroom.h index 16f6c8248..fb002c2bf 100644 --- a/src/Mobs/Mooshroom.h +++ b/src/Mobs/Mooshroom.h @@ -15,7 +15,7 @@ class cMooshroom : public: cMooshroom(void); - CLASS_PROTODEF(cMooshroom); + CLASS_PROTODEF(cMooshroom) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; diff --git a/src/Mobs/Ocelot.h b/src/Mobs/Ocelot.h index adb7a1f75..f2727d354 100644 --- a/src/Mobs/Ocelot.h +++ b/src/Mobs/Ocelot.h @@ -18,7 +18,7 @@ public: { } - CLASS_PROTODEF(cOcelot); + CLASS_PROTODEF(cOcelot) } ; diff --git a/src/Mobs/Pig.h b/src/Mobs/Pig.h index 313af2f44..534a0ca6f 100644 --- a/src/Mobs/Pig.h +++ b/src/Mobs/Pig.h @@ -15,7 +15,7 @@ class cPig : public: cPig(void); - CLASS_PROTODEF(cPig); + CLASS_PROTODEF(cPig) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; diff --git a/src/Mobs/Sheep.h b/src/Mobs/Sheep.h index 5ffd3e4fe..28e1c7254 100644 --- a/src/Mobs/Sheep.h +++ b/src/Mobs/Sheep.h @@ -20,7 +20,7 @@ public: with the GenerateNaturalRandomColor() function. */ cSheep(int a_Color = -1); - CLASS_PROTODEF(cSheep); + CLASS_PROTODEF(cSheep) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void OnRightClicked(cPlayer & a_Player) override; diff --git a/src/Mobs/Silverfish.h b/src/Mobs/Silverfish.h index a6e11c49d..2df333dbc 100644 --- a/src/Mobs/Silverfish.h +++ b/src/Mobs/Silverfish.h @@ -18,7 +18,7 @@ public: { } - CLASS_PROTODEF(cSilverfish); + CLASS_PROTODEF(cSilverfish) } ; diff --git a/src/Mobs/Skeleton.h b/src/Mobs/Skeleton.h index 9a121ef48..577588b32 100644 --- a/src/Mobs/Skeleton.h +++ b/src/Mobs/Skeleton.h @@ -15,7 +15,7 @@ class cSkeleton : public: cSkeleton(bool IsWither); - CLASS_PROTODEF(cSkeleton); + CLASS_PROTODEF(cSkeleton) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void MoveToPosition(const Vector3d & a_Position) override; @@ -24,7 +24,7 @@ public: virtual bool IsUndead(void) override { return true; } - bool IsWither(void) const { return m_bIsWither; }; + bool IsWither(void) const { return m_bIsWither; } private: diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index 15ae113dc..f0b800f94 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -16,7 +16,7 @@ public: /** Creates a slime of the specified size; size can be 1, 2 or 4, with 1 is the smallest and 4 is the tallest. */ cSlime(int a_Size); - CLASS_PROTODEF(cSlime); + CLASS_PROTODEF(cSlime) // cAggressiveMonster overrides: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/SnowGolem.h b/src/Mobs/SnowGolem.h index ff5e90da8..aba89e52d 100644 --- a/src/Mobs/SnowGolem.h +++ b/src/Mobs/SnowGolem.h @@ -15,7 +15,7 @@ class cSnowGolem : public: cSnowGolem(void); - CLASS_PROTODEF(cSnowGolem); + CLASS_PROTODEF(cSnowGolem) virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/Spider.h b/src/Mobs/Spider.h index 51e65d028..813d2e266 100644 --- a/src/Mobs/Spider.h +++ b/src/Mobs/Spider.h @@ -15,7 +15,7 @@ class cSpider : public: cSpider(void); - CLASS_PROTODEF(cSpider); + CLASS_PROTODEF(cSpider) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; } ; diff --git a/src/Mobs/Squid.h b/src/Mobs/Squid.h index a9dba8b70..b57340427 100644 --- a/src/Mobs/Squid.h +++ b/src/Mobs/Squid.h @@ -17,7 +17,7 @@ public: virtual void Tick(float a_Dt, cChunk & a_Chunk) override; - CLASS_PROTODEF(cSquid); + CLASS_PROTODEF(cSquid) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/Villager.h b/src/Mobs/Villager.h index 068dfd835..aa81f0790 100644 --- a/src/Mobs/Villager.h +++ b/src/Mobs/Villager.h @@ -27,7 +27,7 @@ public: cVillager(eVillagerType VillagerType); - CLASS_PROTODEF(cVillager); + CLASS_PROTODEF(cVillager) // cEntity overrides virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; diff --git a/src/Mobs/Witch.h b/src/Mobs/Witch.h index 51c63322a..bd059f61d 100644 --- a/src/Mobs/Witch.h +++ b/src/Mobs/Witch.h @@ -16,7 +16,7 @@ class cWitch : public: cWitch(); - CLASS_PROTODEF(cWitch); + CLASS_PROTODEF(cWitch) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; diff --git a/src/Mobs/Wither.h b/src/Mobs/Wither.h index cc8d1459b..2403823ed 100644 --- a/src/Mobs/Wither.h +++ b/src/Mobs/Wither.h @@ -15,7 +15,7 @@ class cWither : public: cWither(void); - CLASS_PROTODEF(cWither); + CLASS_PROTODEF(cWither) unsigned int GetWitherInvulnerableTicks(void) const { return m_WitherInvulnerableTicks; } diff --git a/src/Mobs/Wolf.h b/src/Mobs/Wolf.h index fb8a7c995..2e83db701 100644 --- a/src/Mobs/Wolf.h +++ b/src/Mobs/Wolf.h @@ -16,7 +16,7 @@ class cWolf : public: cWolf(void); - CLASS_PROTODEF(cWolf); + CLASS_PROTODEF(cWolf) virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override; virtual void OnRightClicked(cPlayer & a_Player) override; diff --git a/src/Mobs/Zombie.h b/src/Mobs/Zombie.h index 082573d8b..118b6e6e7 100644 --- a/src/Mobs/Zombie.h +++ b/src/Mobs/Zombie.h @@ -14,7 +14,7 @@ class cZombie : public: cZombie(bool a_IsVillagerZombie); - CLASS_PROTODEF(cZombie); + CLASS_PROTODEF(cZombie) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void MoveToPosition(const Vector3d & a_Position) override; diff --git a/src/Mobs/ZombiePigman.h b/src/Mobs/ZombiePigman.h index a4bad7efb..bae0115eb 100644 --- a/src/Mobs/ZombiePigman.h +++ b/src/Mobs/ZombiePigman.h @@ -14,7 +14,7 @@ class cZombiePigman : public: cZombiePigman(void); - CLASS_PROTODEF(cZombiePigman); + CLASS_PROTODEF(cZombiePigman) virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override; -- cgit v1.2.3