summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authortycho <work.tycho@gmail.com>2015-05-19 20:32:10 +0200
committertycho <work.tycho@gmail.com>2015-05-19 20:32:10 +0200
commit77f1f58c0a7eb55001b375f1945690ed5c1e87a2 (patch)
tree99e4b53b2966bd4d9bf545d18ddb7edb89472830 /src/Entities
parentAdded LuaState support for all integral types (diff)
downloadcuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.gz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.bz2
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.lz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.xz
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.tar.zst
cuberite-77f1f58c0a7eb55001b375f1945690ed5c1e87a2.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/ArrowEntity.cpp4
-rw-r--r--src/Entities/CMakeLists.txt7
-rw-r--r--src/Entities/Entity.cpp2
-rw-r--r--src/Entities/HangingEntity.h4
-rw-r--r--src/Entities/Minecart.cpp5
-rw-r--r--src/Entities/Pawn.cpp2
-rw-r--r--src/Entities/ProjectileEntity.cpp1
-rw-r--r--src/Entities/ThrownEnderPearlEntity.cpp4
8 files changed, 17 insertions, 12 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp
index 32952100c..0618ac2fc 100644
--- a/src/Entities/ArrowEntity.cpp
+++ b/src/Entities/ArrowEntity.cpp
@@ -108,7 +108,7 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
Damage += m_World->GetTickRandomNumber(Damage / 2 + 2);
}
- int PowerLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPower);
+ unsigned int PowerLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPower);
if (PowerLevel > 0)
{
int ExtraDamage = (int)ceil(0.25 * (PowerLevel + 1));
@@ -116,7 +116,7 @@ void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
}
int KnockbackAmount = 1;
- int PunchLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPunch);
+ unsigned int PunchLevel = m_CreatorData.m_Enchantments.GetLevel(cEnchantments::enchPunch);
if (PunchLevel > 0)
{
Vector3d LookVector = GetLookVector();
diff --git a/src/Entities/CMakeLists.txt b/src/Entities/CMakeLists.txt
index 5d10e1680..44257665e 100644
--- a/src/Entities/CMakeLists.txt
+++ b/src/Entities/CMakeLists.txt
@@ -60,6 +60,13 @@ SET (HDRS
ThrownSnowballEntity.h
WitherSkullEntity.h)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ set_source_files_properties(Entity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=global-constructors -Wno-error=switch-enum")
+ set_source_files_properties(EntityEffect.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
+ set_source_files_properties(Floater.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
+ set_source_files_properties(Player.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=switch-enum -Wno-error=conversion")
+endif()
+
if(NOT MSVC)
add_library(Entities ${SRCS} ${HDRS})
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index bc2b3e93e..941c4196c 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -396,7 +396,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
}
}
- int ThornsLevel = 0;
+ unsigned int ThornsLevel = 0;
const cItem ArmorItems[] = { GetEquippedHelmet(), GetEquippedChestplate(), GetEquippedLeggings(), GetEquippedBoots() };
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
{
diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h
index 9d783006c..4d70cd1a0 100644
--- a/src/Entities/HangingEntity.h
+++ b/src/Entities/HangingEntity.h
@@ -89,7 +89,9 @@ protected:
case BLOCK_FACE_ZM: Dir = 2; break;
case BLOCK_FACE_XM: Dir = 1; break;
case BLOCK_FACE_XP: Dir = 3; break;
- default:
+ case BLOCK_FACE_YP:
+ case BLOCK_FACE_YM:
+ case BLOCK_FACE_NONE:
{
// Uncomment when entities are initialised with their real data, instead of dummy values:
// LOGINFO("Invalid facing (%d) in a cHangingEntity, adjusting to BLOCK_FACE_XP.", a_BlockFace);
diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp
index b80759d24..3adc63129 100644
--- a/src/Entities/Minecart.cpp
+++ b/src/Entities/Minecart.cpp
@@ -1051,11 +1051,6 @@ bool cMinecart::DoTakeDamage(TakeDamageInfo & TDI)
Drops.push_back(cItem(E_ITEM_MINECART_WITH_HOPPER, 1, 0));
break;
}
- default:
- {
- ASSERT(!"Unhandled minecart type when spawning pickup!");
- return true;
- }
}
m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ());
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index fcb686e28..9fdd7026b 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -78,7 +78,7 @@ void cPawn::AddEntityEffect(cEntityEffect::eType a_EffectType, int a_Duration, s
a_Duration = (int)(a_Duration * a_DistanceModifier);
m_EntityEffects[a_EffectType] = cEntityEffect::CreateEntityEffect(a_EffectType, a_Duration, a_Intensity, a_DistanceModifier);
- m_World->BroadcastEntityEffect(*this, a_EffectType, a_Intensity, a_Duration);
+ m_World->BroadcastEntityEffect(*this, a_EffectType, a_Intensity, static_cast<short>(a_Duration));
m_EntityEffects[a_EffectType]->OnActivate(*this);
}
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index 05b7669cd..1f00533db 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -281,6 +281,7 @@ cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator,
return new cFireworkEntity(a_Creator, a_X, a_Y, a_Z, *a_Item);
}
+ case pkFishingFloat: break;
}
LOGWARNING("%s: Unknown projectile kind: %d", __FUNCTION__, a_Kind);
diff --git a/src/Entities/ThrownEnderPearlEntity.cpp b/src/Entities/ThrownEnderPearlEntity.cpp
index f01cdc18c..12d826042 100644
--- a/src/Entities/ThrownEnderPearlEntity.cpp
+++ b/src/Entities/ThrownEnderPearlEntity.cpp
@@ -77,9 +77,9 @@ void cThrownEnderPearlEntity::TeleportCreator(const Vector3d & a_HitPos)
class cProjectileCreatorCallbackForPlayers : public cPlayerListCallback
{
public:
- cProjectileCreatorCallbackForPlayers(cEntity * a_Attacker, Vector3i a_HitPos) :
+ cProjectileCreatorCallbackForPlayers(cEntity * a_Attacker, Vector3i a_CallbackHitPos) :
m_Attacker(a_Attacker),
- m_HitPos(a_HitPos)
+ m_HitPos(a_CallbackHitPos)
{
}