From f94df06b6601f9dcecd383f5d093d225f41d1c65 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 9 Sep 2014 03:02:25 +0200 Subject: Added the player list to the 1.8 protocol. --- src/Entities/Entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9bcdcffeb..fba688847 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -135,7 +135,7 @@ const char * cEntity::GetParentClass(void) const bool cEntity::Initialize(cWorld & a_World) { - if (cPluginManager::Get()->CallHookSpawningEntity(a_World, *this)) + if (cPluginManager::Get()->CallHookSpawningEntity(a_World, *this) && !IsPlayer()) { return false; } -- cgit v1.2.3 From 6e7c0e33b5dd6d86d66ac2eb1a07a33652a708fd Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 17 Sep 2014 18:40:10 +0100 Subject: Added first test to show the object can be created --- src/Entities/Entity.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9bcdcffeb..4581eeda8 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -334,10 +334,10 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) cMonster * Monster = (cMonster *)this; switch (Monster->GetMobType()) { - case cMonster::mtSkeleton: - case cMonster::mtZombie: - case cMonster::mtWither: - case cMonster::mtZombiePigman: + case mtSkeleton: + case mtZombie: + case mtWither: + case mtZombiePigman: { a_TDI.FinalDamage += (int)ceil(2.5 * SmiteLevel); break; @@ -352,9 +352,9 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) cMonster * Monster = (cMonster *)this; switch (Monster->GetMobType()) { - case cMonster::mtSpider: - case cMonster::mtCaveSpider: - case cMonster::mtSilverfish: + case mtSpider: + case mtCaveSpider: + case mtSilverfish: { a_TDI.RawDamage += (int)ceil(2.5 * BaneOfArthropodsLevel); // TODO: Add slowness effect @@ -384,9 +384,9 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) cMonster * Monster = (cMonster *)this; switch (Monster->GetMobType()) { - case cMonster::mtGhast: - case cMonster::mtZombiePigman: - case cMonster::mtMagmaCube: + case mtGhast: + case mtZombiePigman: + case mtMagmaCube: { break; }; -- cgit v1.2.3 From 195b646aa4189ec9858f4994754eadd2c05ef9df Mon Sep 17 00:00:00 2001 From: Chris Darnell Date: Mon, 22 Sep 2014 03:22:36 -0400 Subject: Made it compile with clang --- src/Entities/Entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 42b207c48..996f2fff3 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -260,7 +260,7 @@ void cEntity::TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_R void cEntity::SetYawFromSpeed(void) { const double EPS = 0.0000001; - if ((abs(m_Speed.x) < EPS) && (abs(m_Speed.z) < EPS)) + if ((std::abs(m_Speed.x) < EPS) && (std::abs(m_Speed.z) < EPS)) { // atan2() may overflow or is undefined, pick any number SetYaw(0); @@ -277,7 +277,7 @@ void cEntity::SetPitchFromSpeed(void) { const double EPS = 0.0000001; double xz = sqrt(m_Speed.x * m_Speed.x + m_Speed.z * m_Speed.z); // Speed XZ-plane component - if ((abs(xz) < EPS) && (abs(m_Speed.y) < EPS)) + if ((std::abs(xz) < EPS) && (std::abs(m_Speed.y) < EPS)) { // atan2() may overflow or is undefined, pick any number SetPitch(0); -- cgit v1.2.3 From 806871b86f2f04545f20caa6a8c30db2ccb7bc12 Mon Sep 17 00:00:00 2001 From: Chris Darnell Date: Mon, 22 Sep 2014 18:23:56 -0400 Subject: A few compiler warning fixes --- src/Entities/Entity.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index c8ebc4314..8ef24828e 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -342,6 +342,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI) a_TDI.FinalDamage += (int)ceil(2.5 * SmiteLevel); break; } + default: break; } } } @@ -1015,7 +1016,7 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk) if (Tracer.HitNormal.y != 0.f) NextSpeed.y = 0.f; if (Tracer.HitNormal.z != 0.f) NextSpeed.z = 0.f; - if (Tracer.HitNormal.y == 1) // Hit BLOCK_FACE_YP, we are on the ground + if (Tracer.HitNormal.y == 1.f) // Hit BLOCK_FACE_YP, we are on the ground { m_bOnGround = true; } @@ -1960,7 +1961,7 @@ void cEntity::SteerVehicle(float a_Forward, float a_Sideways) { return; } - if ((a_Forward != 0) || (a_Sideways != 0)) + if ((a_Forward != 0.f) || (a_Sideways != 0.f)) { m_AttachedTo->HandleSpeedFromAttachee(a_Forward, a_Sideways); } -- cgit v1.2.3 From a3f940f47c8981146feed66225c1dd8066bac0e2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 26 Sep 2014 18:13:19 +0100 Subject: Removed more unessicary includes --- src/Entities/Entity.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index c733d60ad..da85dec50 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -3,7 +3,6 @@ #include "Entity.h" #include "../World.h" -#include "../Server.h" #include "../Root.h" #include "../Matrix4.h" #include "../ClientHandle.h" -- cgit v1.2.3