A few compiler warning fixes
This commit is contained in:
parent
1aa64f32e1
commit
806871b86f
@ -6,7 +6,7 @@ class cRedstonePoweredEntity
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~cRedstonePoweredEntity() {};
|
||||
virtual ~cRedstonePoweredEntity() {}
|
||||
|
||||
/// Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate
|
||||
virtual void SetRedstonePower(bool a_IsPowered) = 0;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ int cEntityEffect::GetPotionEffectDuration(short a_ItemDamage)
|
||||
base = 1800;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
// If potion is level II, half the duration. If not, stays the same
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "Player.h"
|
||||
#include "../BoundingBox.h"
|
||||
|
||||
#define NO_SPEED 0.0
|
||||
#define MAX_SPEED 8
|
||||
#define MAX_SPEED_NEGATIVE -MAX_SPEED
|
||||
|
||||
@ -220,7 +221,7 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedZ() != 0) // Don't do anything if cart is stationary
|
||||
if (GetSpeedZ() != NO_SPEED) // Don't do anything if cart is stationary
|
||||
{
|
||||
if (GetSpeedZ() > 0)
|
||||
{
|
||||
@ -239,13 +240,13 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
||||
{
|
||||
SetYaw(180);
|
||||
SetPosY(floor(GetPosY()) + 0.55);
|
||||
SetSpeedY(0);
|
||||
SetSpeedZ(0);
|
||||
SetSpeedY(NO_SPEED);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedX() != 0)
|
||||
if (GetSpeedX() != NO_SPEED)
|
||||
{
|
||||
if (GetSpeedX() > 0)
|
||||
{
|
||||
@ -305,9 +306,9 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, float a_Dt)
|
||||
case E_META_RAIL_ASCEND_XM: // ASCEND EAST
|
||||
{
|
||||
SetYaw(180);
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
|
||||
if (GetSpeedX() >= 0)
|
||||
if (GetSpeedX() >= NO_SPEED)
|
||||
{
|
||||
if (GetSpeedX() <= MAX_SPEED)
|
||||
{
|
||||
@ -424,9 +425,9 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedZ() != 0)
|
||||
if (GetSpeedZ() != NO_SPEED)
|
||||
{
|
||||
if (GetSpeedZ() > 0)
|
||||
if (GetSpeedZ() > NO_SPEED)
|
||||
{
|
||||
AddSpeedZ(AccelDecelSpeed);
|
||||
}
|
||||
@ -441,15 +442,15 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
{
|
||||
SetYaw(180);
|
||||
SetPosY(floor(GetPosY()) + 0.55);
|
||||
SetSpeedY(0);
|
||||
SetSpeedZ(0);
|
||||
SetSpeedY(NO_SPEED);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
|
||||
bool BlckCol = TestBlockCollision(a_RailMeta), EntCol = TestEntityCollision(a_RailMeta);
|
||||
if (EntCol || BlckCol) return;
|
||||
|
||||
if (GetSpeedX() != 0)
|
||||
if (GetSpeedX() != NO_SPEED)
|
||||
{
|
||||
if (GetSpeedX() > 0)
|
||||
if (GetSpeedX() > NO_SPEED)
|
||||
{
|
||||
AddSpeedX(AccelDecelSpeed);
|
||||
}
|
||||
@ -463,9 +464,9 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_XM: // ASCEND EAST
|
||||
{
|
||||
SetYaw(180);
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
|
||||
if (GetSpeedX() >= 0)
|
||||
if (GetSpeedX() >= NO_SPEED)
|
||||
{
|
||||
if (GetSpeedX() <= MAX_SPEED)
|
||||
{
|
||||
@ -483,9 +484,9 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_XP: // ASCEND WEST
|
||||
{
|
||||
SetYaw(180);
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
|
||||
if (GetSpeedX() > 0)
|
||||
if (GetSpeedX() > NO_SPEED)
|
||||
{
|
||||
AddSpeedX(AccelDecelSpeed);
|
||||
SetSpeedY(GetSpeedX());
|
||||
@ -503,9 +504,9 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_ZM: // ASCEND NORTH
|
||||
{
|
||||
SetYaw(270);
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
|
||||
if (GetSpeedZ() >= 0)
|
||||
if (GetSpeedZ() >= NO_SPEED)
|
||||
{
|
||||
if (GetSpeedZ() <= MAX_SPEED)
|
||||
{
|
||||
@ -523,9 +524,9 @@ void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_ZP: // ASCEND SOUTH
|
||||
{
|
||||
SetYaw(270);
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
|
||||
if (GetSpeedZ() > 0)
|
||||
if (GetSpeedZ() > NO_SPEED)
|
||||
{
|
||||
AddSpeedZ(AccelDecelSpeed);
|
||||
SetSpeedY(GetSpeedZ());
|
||||
@ -576,7 +577,7 @@ void cMinecart::SnapToRail(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_XP:
|
||||
case E_META_RAIL_XM_XP:
|
||||
{
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
SetPosZ(floor(GetPosZ()) + 0.5);
|
||||
break;
|
||||
}
|
||||
@ -584,7 +585,7 @@ void cMinecart::SnapToRail(NIBBLETYPE a_RailMeta)
|
||||
case E_META_RAIL_ASCEND_ZP:
|
||||
case E_META_RAIL_ZM_ZP:
|
||||
{
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
SetPosX(floor(GetPosX()) + 0.5);
|
||||
break;
|
||||
}
|
||||
@ -593,12 +594,12 @@ void cMinecart::SnapToRail(NIBBLETYPE a_RailMeta)
|
||||
{
|
||||
if (GetPosZ() > floor(GetPosZ()) + 0.5)
|
||||
{
|
||||
if (GetSpeedZ() > 0)
|
||||
if (GetSpeedZ() > NO_SPEED)
|
||||
{
|
||||
SetSpeedX(-GetSpeedZ() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
SetPosZ(floor(GetPosZ()) + 0.5);
|
||||
}
|
||||
else if (GetPosX() > floor(GetPosX()) + 0.5)
|
||||
@ -608,82 +609,82 @@ void cMinecart::SnapToRail(NIBBLETYPE a_RailMeta)
|
||||
SetSpeedZ(-GetSpeedX() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
SetPosX(floor(GetPosX()) + 0.5);
|
||||
}
|
||||
SetSpeedY(0);
|
||||
SetSpeedY(NO_SPEED);
|
||||
break;
|
||||
}
|
||||
case E_META_RAIL_CURVED_ZM_XP:
|
||||
{
|
||||
if (GetPosZ() > floor(GetPosZ()) + 0.5)
|
||||
{
|
||||
if (GetSpeedZ() > 0)
|
||||
if (GetSpeedZ() > NO_SPEED)
|
||||
{
|
||||
SetSpeedX(GetSpeedZ() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
SetPosZ(floor(GetPosZ()) + 0.5);
|
||||
}
|
||||
else if (GetPosX() < floor(GetPosX()) + 0.5)
|
||||
{
|
||||
if (GetSpeedX() < 0)
|
||||
if (GetSpeedX() < NO_SPEED)
|
||||
{
|
||||
SetSpeedZ(GetSpeedX() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
SetPosX(floor(GetPosX()) + 0.5);
|
||||
}
|
||||
SetSpeedY(0);
|
||||
SetSpeedY(NO_SPEED);
|
||||
break;
|
||||
}
|
||||
case E_META_RAIL_CURVED_ZP_XM:
|
||||
{
|
||||
if (GetPosZ() < floor(GetPosZ()) + 0.5)
|
||||
{
|
||||
if (GetSpeedZ() < 0)
|
||||
if (GetSpeedZ() < NO_SPEED)
|
||||
{
|
||||
SetSpeedX(GetSpeedZ() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
SetPosZ(floor(GetPosZ()) + 0.5);
|
||||
}
|
||||
else if (GetPosX() > floor(GetPosX()) + 0.5)
|
||||
{
|
||||
if (GetSpeedX() > 0)
|
||||
if (GetSpeedX() > NO_SPEED)
|
||||
{
|
||||
SetSpeedZ(GetSpeedX() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
SetPosX(floor(GetPosX()) + 0.5);
|
||||
}
|
||||
SetSpeedY(0);
|
||||
SetSpeedY(NO_SPEED);
|
||||
break;
|
||||
}
|
||||
case E_META_RAIL_CURVED_ZP_XP:
|
||||
{
|
||||
if (GetPosZ() < floor(GetPosZ()) + 0.5)
|
||||
{
|
||||
if (GetSpeedZ() < 0)
|
||||
if (GetSpeedZ() < NO_SPEED)
|
||||
{
|
||||
SetSpeedX(-GetSpeedZ() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedZ(0);
|
||||
SetSpeedZ(NO_SPEED);
|
||||
SetPosZ(floor(GetPosZ()) + 0.5);
|
||||
}
|
||||
else if (GetPosX() < floor(GetPosX()) + 0.5)
|
||||
{
|
||||
if (GetSpeedX() < 0)
|
||||
if (GetSpeedX() < NO_SPEED)
|
||||
{
|
||||
SetSpeedZ(-GetSpeedX() * 0.7);
|
||||
}
|
||||
|
||||
SetSpeedX(0);
|
||||
SetSpeedX(NO_SPEED);
|
||||
SetPosX(floor(GetPosX()) + 0.5);
|
||||
}
|
||||
SetSpeedY(0);
|
||||
|
@ -283,7 +283,7 @@ int cTracer::intersect3D_SegmentPlane( const Vector3f & a_Origin, const Vector3f
|
||||
if (fabs(D) < EPSILON)
|
||||
{
|
||||
// segment is parallel to plane
|
||||
if (N == 0)
|
||||
if (N == 0.0)
|
||||
{
|
||||
// segment lies in plane
|
||||
return 2;
|
||||
|
Loading…
Reference in New Issue
Block a user