summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-02-04 19:59:05 +0100
committerTycho <work.tycho+git@gmail.com>2014-02-04 19:59:05 +0100
commit8464f689ea214d3c30105ae58539885cf1268317 (patch)
tree4e165031ed1528e4fd7c704850b62c543baf8d3f /src/Entities
parentFixed calling plugins with userdata params. (diff)
downloadcuberite-8464f689ea214d3c30105ae58539885cf1268317.tar
cuberite-8464f689ea214d3c30105ae58539885cf1268317.tar.gz
cuberite-8464f689ea214d3c30105ae58539885cf1268317.tar.bz2
cuberite-8464f689ea214d3c30105ae58539885cf1268317.tar.lz
cuberite-8464f689ea214d3c30105ae58539885cf1268317.tar.xz
cuberite-8464f689ea214d3c30105ae58539885cf1268317.tar.zst
cuberite-8464f689ea214d3c30105ae58539885cf1268317.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Floater.cpp4
-rw-r--r--src/Entities/ProjectileEntity.cpp22
-rw-r--r--src/Entities/ProjectileEntity.h18
3 files changed, 22 insertions, 22 deletions
diff --git a/src/Entities/Floater.cpp b/src/Entities/Floater.cpp
index dfe77f059..38160a30e 100644
--- a/src/Entities/Floater.cpp
+++ b/src/Entities/Floater.cpp
@@ -35,7 +35,7 @@ public:
cBoundingBox EntBox(a_Entity->GetPosition(), a_Entity->GetWidth() / 2, a_Entity->GetHeight());
double LineCoeff;
- char Face;
+ eBlockFace Face;
EntBox.Expand(m_Floater->GetWidth() / 2, m_Floater->GetHeight() / 2, m_Floater->GetWidth() / 2);
if (!EntBox.CalcLineIntersection(m_Pos, m_NextPos, LineCoeff, Face))
{
@@ -215,4 +215,4 @@ void cFloater::Tick(float a_Dt, cChunk & a_Chunk)
SetSpeedZ(GetSpeedZ() * 0.95);
BroadcastMovementUpdate();
-} \ No newline at end of file
+}
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index bffa790a3..a3fa9d557 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -63,7 +63,7 @@ protected:
Vector3d Line1 = m_Projectile->GetPosition();
Vector3d Line2 = Line1 + m_Projectile->GetSpeed();
double LineCoeff = 0;
- char Face;
+ eBlockFace Face;
if (bb.CalcLineIntersection(Line1, Line2, LineCoeff, Face))
{
Vector3d Intersection = Line1 + m_Projectile->GetSpeed() * LineCoeff;
@@ -138,7 +138,7 @@ public:
// Instead of colliding the bounding box with another bounding box in motion, we collide an enlarged bounding box with a hairline.
// The results should be good enough for our purposes
double LineCoeff;
- char Face;
+ eBlockFace Face;
EntBox.Expand(m_Projectile->GetWidth() / 2, m_Projectile->GetHeight() / 2, m_Projectile->GetWidth() / 2);
if (!EntBox.CalcLineIntersection(m_Pos, m_NextPos, LineCoeff, Face))
{
@@ -243,7 +243,7 @@ cProjectileEntity * cProjectileEntity::Create(eKind a_Kind, cEntity * a_Creator,
-void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
// Set the position based on what face was hit:
SetPosition(a_HitPos);
@@ -446,7 +446,7 @@ bool cArrowEntity::CanPickup(const cPlayer & a_Player) const
-void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
if (a_HitFace == BLOCK_FACE_NONE) { return; }
@@ -590,7 +590,7 @@ cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y,
-void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
if (m_World->GetTickRandomNumber(7) == 1)
{
@@ -623,7 +623,7 @@ cThrownEnderPearlEntity::cThrownEnderPearlEntity(cEntity * a_Creator, double a_X
-void cThrownEnderPearlEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cThrownEnderPearlEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
// Teleport the creator here, make them take 5 damage:
if (m_Creator != NULL)
@@ -653,7 +653,7 @@ cThrownSnowballEntity::cThrownSnowballEntity(cEntity * a_Creator, double a_X, do
-void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
// TODO: Apply damage to certain mobs (blaze etc.) and anger all mobs
@@ -677,7 +677,7 @@ super(pkExpBottle, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25)
-void cExpBottleEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cExpBottleEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
// Spawn an experience orb with a reward between 3 and 11.
m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), 3 + m_World->GetTickRandomNumber(8));
@@ -701,7 +701,7 @@ super(pkFirework, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25)
-void cFireworkEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cFireworkEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
if ((a_HitFace != BLOCK_FACE_BOTTOM) && (a_HitFace != BLOCK_FACE_NONE))
{
@@ -784,7 +784,7 @@ void cGhastFireballEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
-void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
Destroy();
Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
@@ -830,7 +830,7 @@ void cFireChargeEntity::Explode(int a_BlockX, int a_BlockY, int a_BlockZ)
-void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace)
+void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
{
Destroy();
Explode((int)floor(a_HitPos.x), (int)floor(a_HitPos.y), (int)floor(a_HitPos.z));
diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h
index 4721409ee..e80592999 100644
--- a/src/Entities/ProjectileEntity.h
+++ b/src/Entities/ProjectileEntity.h
@@ -49,7 +49,7 @@ public:
static cProjectileEntity * Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d * a_Speed = NULL);
/// Called by the physics blocktracer when the entity hits a solid block, the hit position and the face hit (BLOCK_FACE_) is given
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace);
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace);
/// Called by the physics blocktracer when the entity hits another entity
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
@@ -174,7 +174,7 @@ protected:
Vector3i m_HitBlockPos;
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
virtual void CollectedBy(cPlayer * a_Player) override;
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
@@ -204,7 +204,7 @@ protected:
// tolua_end
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
// tolua_begin
@@ -232,7 +232,7 @@ protected:
// tolua_end
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
// tolua_begin
@@ -258,7 +258,7 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
// tolua_begin
@@ -284,7 +284,7 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
// tolua_begin
@@ -310,7 +310,7 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void HandlePhysics(float a_Dt, cChunk & a_Chunk) override;
// tolua_begin
@@ -339,7 +339,7 @@ protected:
void Explode(int a_BlockX, int a_BlockY, int a_BlockZ);
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
// TODO: Deflecting the fireballs by arrow- or sword- hits
@@ -370,7 +370,7 @@ protected:
void Explode(int a_BlockX, int a_BlockY, int a_BlockZ);
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, char a_HitFace) override;
+ virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
// tolua_begin