summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Entities/ArrowEntity.cpp6
-rw-r--r--src/Entities/ArrowEntity.h4
-rw-r--r--src/Entities/Boat.cpp4
-rw-r--r--src/Entities/Boat.h2
-rw-r--r--src/Entities/Entity.h2
-rw-r--r--src/Entities/ExpBottleEntity.cpp18
-rw-r--r--src/Entities/ExpBottleEntity.h10
-rw-r--r--src/Entities/FireChargeEntity.cpp4
-rw-r--r--src/Entities/FireChargeEntity.h4
-rw-r--r--src/Entities/GhastFireballEntity.cpp4
-rw-r--r--src/Entities/GhastFireballEntity.h4
-rw-r--r--src/Entities/ProjectileEntity.cpp4
-rw-r--r--src/Entities/ProjectileEntity.h4
-rw-r--r--src/Entities/SplashPotionEntity.cpp10
-rw-r--r--src/Entities/SplashPotionEntity.h6
-rw-r--r--src/Entities/TNTEntity.cpp14
-rw-r--r--src/Entities/TNTEntity.h3
-rw-r--r--src/Entities/ThrownEggEntity.cpp6
-rw-r--r--src/Entities/ThrownEggEntity.h6
-rw-r--r--src/Entities/ThrownEnderPearlEntity.cpp6
-rw-r--r--src/Entities/ThrownEnderPearlEntity.h6
-rw-r--r--src/Entities/ThrownSnowballEntity.cpp4
-rw-r--r--src/Entities/ThrownSnowballEntity.h4
-rw-r--r--src/Entities/WitherSkullEntity.cpp4
-rw-r--r--src/Entities/WitherSkullEntity.h4
25 files changed, 71 insertions, 72 deletions
diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp
index 6259098d8..2c1a1f005 100644
--- a/src/Entities/ArrowEntity.cpp
+++ b/src/Entities/ArrowEntity.cpp
@@ -76,7 +76,7 @@ bool cArrowEntity::CanPickup(const cPlayer & a_Player) const
-void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cArrowEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
Vector3d Hit = a_HitPos;
Hit += GetSpeed().NormalizeCopy() / 100000; // Make arrow sink into block a bit so it lodges (TODO: investigate how to stop them going so far so that they become black clientside)
@@ -93,7 +93,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFa
if ((m_World->GetBlock(Hit) == E_BLOCK_TNT) && IsOnFire())
{
m_World->SetBlock(X, Y, Z, E_BLOCK_AIR, 0);
- m_World->SpawnPrimedTNT(X, Y, Z);
+ m_World->SpawnPrimedTNT(Vector3d(BlockHit));
}
}
@@ -102,7 +102,7 @@ void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFa
-void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
super::OnHitEntity(a_EntityHit, a_HitPos);
diff --git a/src/Entities/ArrowEntity.h b/src/Entities/ArrowEntity.h
index 7ed99b79e..6e4644190 100644
--- a/src/Entities/ArrowEntity.h
+++ b/src/Entities/ArrowEntity.h
@@ -100,8 +100,8 @@ protected:
Vector3i m_HitBlockPos;
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
virtual void CollectedBy(cPlayer & a_Player) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp
index cdb12123c..4021f9ce8 100644
--- a/src/Entities/Boat.cpp
+++ b/src/Entities/Boat.cpp
@@ -13,8 +13,8 @@
-cBoat::cBoat(double a_X, double a_Y, double a_Z, eMaterial a_Material) :
- super(etBoat, a_X, a_Y, a_Z, 0.98, 0.7),
+cBoat::cBoat(Vector3d a_Pos, eMaterial a_Material) :
+ super(etBoat, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.7),
m_LastDamage(0), m_ForwardDirection(0),
m_DamageTaken(0.0f), m_Material(a_Material),
m_RightPaddleUsed(false), m_LeftPaddleUsed(false)
diff --git a/src/Entities/Boat.h b/src/Entities/Boat.h
index a6a99d683..1a00d48c9 100644
--- a/src/Entities/Boat.h
+++ b/src/Entities/Boat.h
@@ -42,7 +42,7 @@ public:
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways) override;
- cBoat(double a_X, double a_Y, double a_Z, eMaterial a_Material);
+ cBoat(Vector3d a_Pos, eMaterial a_Material);
int GetLastDamage(void) const { return m_LastDamage; }
int GetForwardDirection(void) const { return m_ForwardDirection; }
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index f39039183..7b934fb23 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -232,7 +232,7 @@ public:
void SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ);
/** Sets the speed of the entity, measured in m / sec */
- void SetSpeed(const Vector3d & a_Speed) { SetSpeed(a_Speed.x, a_Speed.y, a_Speed.z); }
+ void SetSpeed(Vector3d a_Speed) { SetSpeed(a_Speed.x, a_Speed.y, a_Speed.z); }
/** Sets the speed in the X axis, leaving the other speed components intact. Measured in m / sec. */
void SetSpeedX(double a_SpeedX);
diff --git a/src/Entities/ExpBottleEntity.cpp b/src/Entities/ExpBottleEntity.cpp
index 4072b939b..a9d250118 100644
--- a/src/Entities/ExpBottleEntity.cpp
+++ b/src/Entities/ExpBottleEntity.cpp
@@ -8,7 +8,7 @@
-cExpBottleEntity::cExpBottleEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed) :
+cExpBottleEntity::cExpBottleEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, Vector3d a_Speed) :
super(pkExpBottle, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25)
{
SetSpeed(a_Speed);
@@ -18,7 +18,17 @@ cExpBottleEntity::cExpBottleEntity(cEntity * a_Creator, double a_X, double a_Y,
-void cExpBottleEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+cExpBottleEntity::cExpBottleEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed) :
+ super(pkExpBottle, a_Creator, a_Pos.x, a_Pos.y, a_Pos.z, 0.25, 0.25)
+{
+ SetSpeed(a_Speed);
+}
+
+
+
+
+
+void cExpBottleEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
Break(a_HitPos);
}
@@ -27,7 +37,7 @@ void cExpBottleEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_H
-void cExpBottleEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cExpBottleEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
Break(a_HitPos);
}
@@ -36,7 +46,7 @@ void cExpBottleEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_Hit
-void cExpBottleEntity::Break(const Vector3d &a_HitPos)
+void cExpBottleEntity::Break(Vector3d a_HitPos)
{
// Spawn an experience orb with a reward between 3 and 11.
m_World->BroadcastSoundParticleEffect(EffectID::PARTICLE_SPLASH_POTION, POSX_TOINT, POSY_TOINT, POSZ_TOINT, 0);
diff --git a/src/Entities/ExpBottleEntity.h b/src/Entities/ExpBottleEntity.h
index ea0c2b5a9..1fcc9b138 100644
--- a/src/Entities/ExpBottleEntity.h
+++ b/src/Entities/ExpBottleEntity.h
@@ -28,17 +28,19 @@ public:
CLASS_PROTODEF(cExpBottleEntity)
- cExpBottleEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed);
+ cExpBottleEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, Vector3d a_Speed);
+
+ cExpBottleEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed);
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity (cEntity & a_EntityHit, Vector3d a_HitPos) override;
/** Breaks the bottle, fires its particle effects and sounds
@param a_HitPos The position where the bottle will break */
- void Break(const Vector3d & a_HitPos);
+ void Break(Vector3d a_HitPos);
}; // tolua_export
diff --git a/src/Entities/FireChargeEntity.cpp b/src/Entities/FireChargeEntity.cpp
index 83c1f3c76..5432f9206 100644
--- a/src/Entities/FireChargeEntity.cpp
+++ b/src/Entities/FireChargeEntity.cpp
@@ -31,7 +31,7 @@ void cFireChargeEntity::Explode(Vector3i a_Block)
-void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cFireChargeEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
Destroy();
Explode(a_HitPos.Floor());
@@ -41,7 +41,7 @@ void cFireChargeEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_
-void cFireChargeEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cFireChargeEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
super::OnHitEntity(a_EntityHit, a_HitPos);
diff --git a/src/Entities/FireChargeEntity.h b/src/Entities/FireChargeEntity.h
index e17b25903..2ea64d1e3 100644
--- a/src/Entities/FireChargeEntity.h
+++ b/src/Entities/FireChargeEntity.h
@@ -35,8 +35,8 @@ protected:
void Explode(Vector3i a_Block);
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
} ; // tolua_export
diff --git a/src/Entities/GhastFireballEntity.cpp b/src/Entities/GhastFireballEntity.cpp
index 1adfd1bc0..2dbfbf481 100644
--- a/src/Entities/GhastFireballEntity.cpp
+++ b/src/Entities/GhastFireballEntity.cpp
@@ -28,7 +28,7 @@ void cGhastFireballEntity::Explode(Vector3i a_Block)
-void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cGhastFireballEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
Destroy();
Explode(a_HitPos.Floor());
@@ -38,7 +38,7 @@ void cGhastFireballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace
-void cGhastFireballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cGhastFireballEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
Destroy();
Explode(a_HitPos.Floor());
diff --git a/src/Entities/GhastFireballEntity.h b/src/Entities/GhastFireballEntity.h
index 620efd9e6..bf5b333e2 100644
--- a/src/Entities/GhastFireballEntity.h
+++ b/src/Entities/GhastFireballEntity.h
@@ -35,8 +35,8 @@ protected:
void Explode(Vector3i a_Block);
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
// TODO: Deflecting the fireballs by arrow- or sword- hits
diff --git a/src/Entities/ProjectileEntity.cpp b/src/Entities/ProjectileEntity.cpp
index c2a1f782d..1017f954a 100644
--- a/src/Entities/ProjectileEntity.cpp
+++ b/src/Entities/ProjectileEntity.cpp
@@ -300,7 +300,7 @@ std::unique_ptr<cProjectileEntity> cProjectileEntity::Create(eKind a_Kind, cEnti
-void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cProjectileEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
// Set the position based on what face was hit:
SetPosition(a_HitPos);
@@ -320,7 +320,7 @@ void cProjectileEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_
-void cProjectileEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cProjectileEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
UNUSED(a_HitPos);
diff --git a/src/Entities/ProjectileEntity.h b/src/Entities/ProjectileEntity.h
index da8c650f5..36f53c841 100644
--- a/src/Entities/ProjectileEntity.h
+++ b/src/Entities/ProjectileEntity.h
@@ -49,10 +49,10 @@ public:
static std::unique_ptr<cProjectileEntity> Create(eKind a_Kind, cEntity * a_Creator, double a_X, double a_Y, double a_Z, const cItem * a_Item, const Vector3d * a_Speed = nullptr);
/** 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, eBlockFace a_HitFace);
+ virtual void OnHitSolidBlock(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);
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos);
/** Called by Chunk when the projectile is eligible for player collection */
virtual void CollectedBy(cPlayer & a_Dest);
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp
index af4008e83..8356806b3 100644
--- a/src/Entities/SplashPotionEntity.cpp
+++ b/src/Entities/SplashPotionEntity.cpp
@@ -28,7 +28,7 @@ public:
@param a_HitPos The position where the splash potion has splashed
@param a_EntityEffectType The effect type of the potion
@param a_EntityEffect The effect description */
- cSplashPotionCallback(const Vector3d & a_HitPos, cEntityEffect::eType a_EntityEffectType, const cEntityEffect & a_EntityEffect) :
+ cSplashPotionCallback(Vector3d a_HitPos, cEntityEffect::eType a_EntityEffectType, const cEntityEffect & a_EntityEffect) :
m_HitPos(a_HitPos),
m_EntityEffectType(a_EntityEffectType),
m_EntityEffect(a_EntityEffect)
@@ -61,7 +61,7 @@ public:
}
private:
- const Vector3d & m_HitPos;
+ Vector3d m_HitPos;
cEntityEffect::eType m_EntityEffectType;
const cEntityEffect & m_EntityEffect;
};
@@ -96,7 +96,7 @@ cSplashPotionEntity::cSplashPotionEntity(
-void cSplashPotionEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cSplashPotionEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
Splash(a_HitPos);
m_DestroyTimer = 2;
@@ -106,7 +106,7 @@ void cSplashPotionEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace
-void cSplashPotionEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cSplashPotionEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
a_EntityHit.TakeDamage(dtRangedAttack, this, 0, 1);
Splash(a_HitPos);
@@ -117,7 +117,7 @@ void cSplashPotionEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_
-void cSplashPotionEntity::Splash(const Vector3d & a_HitPos)
+void cSplashPotionEntity::Splash(Vector3d a_HitPos)
{
cSplashPotionCallback Callback(a_HitPos, m_EntityEffectType, m_EntityEffect);
m_World->ForEachEntity(Callback);
diff --git a/src/Entities/SplashPotionEntity.h b/src/Entities/SplashPotionEntity.h
index baa5da725..fc364404b 100644
--- a/src/Entities/SplashPotionEntity.h
+++ b/src/Entities/SplashPotionEntity.h
@@ -60,8 +60,8 @@ protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity (cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity (cEntity & a_EntityHit, Vector3d a_HitPos) override;
virtual void Tick (std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override
{
if (m_DestroyTimer > 0)
@@ -81,7 +81,7 @@ protected:
/** Splashes the potion, fires its particle effects and sounds
@param a_HitPos The position where the potion will splash */
- void Splash(const Vector3d & a_HitPos);
+ void Splash(Vector3d a_HitPos);
virtual void SpawnOn(cClientHandle & a_Client) override;
diff --git a/src/Entities/TNTEntity.cpp b/src/Entities/TNTEntity.cpp
index 6784f19f5..26217cfcd 100644
--- a/src/Entities/TNTEntity.cpp
+++ b/src/Entities/TNTEntity.cpp
@@ -8,19 +8,7 @@
-cTNTEntity::cTNTEntity(double a_X, double a_Y, double a_Z, int a_FuseTicks) :
- super(etTNT, a_X, a_Y, a_Z, 0.98, 0.98),
- m_FuseTicks(a_FuseTicks)
-{
- SetGravity(-16.0f);
- SetAirDrag(0.02f);
-}
-
-
-
-
-
-cTNTEntity::cTNTEntity(const Vector3d & a_Pos, int a_FuseTicks) :
+cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
super(etTNT, a_Pos.x, a_Pos.y, a_Pos.z, 0.98, 0.98),
m_FuseTicks(a_FuseTicks)
{
diff --git a/src/Entities/TNTEntity.h b/src/Entities/TNTEntity.h
index 5f1faa6b4..25c74ded5 100644
--- a/src/Entities/TNTEntity.h
+++ b/src/Entities/TNTEntity.h
@@ -16,8 +16,7 @@ public:
// tolua_end
CLASS_PROTODEF(cTNTEntity)
- cTNTEntity(double a_X, double a_Y, double a_Z, int a_FuseTicks = 80);
- cTNTEntity(const Vector3d & a_Pos, int a_FuseTicks = 80);
+ cTNTEntity(Vector3d a_Pos, int a_FuseTicks = 80);
// cEntity overrides:
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
diff --git a/src/Entities/ThrownEggEntity.cpp b/src/Entities/ThrownEggEntity.cpp
index 3131f4841..226f37fb6 100644
--- a/src/Entities/ThrownEggEntity.cpp
+++ b/src/Entities/ThrownEggEntity.cpp
@@ -18,7 +18,7 @@ cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, double a_X, double a_Y,
-void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cThrownEggEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
TrySpawnChicken(a_HitPos);
@@ -29,7 +29,7 @@ void cThrownEggEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_H
-void cThrownEggEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cThrownEggEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
int TotalDamage = 0;
// If entity is an Ender Dragon or Ender Crystal, it is damaged.
@@ -72,7 +72,7 @@ void cThrownEggEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
-void cThrownEggEntity::TrySpawnChicken(const Vector3d & a_HitPos)
+void cThrownEggEntity::TrySpawnChicken(Vector3d a_HitPos)
{
auto & Random = GetRandomProvider();
if (Random.RandBool(0.125))
diff --git a/src/Entities/ThrownEggEntity.h b/src/Entities/ThrownEggEntity.h
index f20cd41a1..071b974cb 100644
--- a/src/Entities/ThrownEggEntity.h
+++ b/src/Entities/ThrownEggEntity.h
@@ -33,12 +33,12 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
// Randomly decides whether to spawn a chicken where the egg lands.
- void TrySpawnChicken(const Vector3d & a_HitPos);
+ void TrySpawnChicken(Vector3d a_HitPos);
private:
diff --git a/src/Entities/ThrownEnderPearlEntity.cpp b/src/Entities/ThrownEnderPearlEntity.cpp
index 4b2e2f9ff..4dedffc5b 100644
--- a/src/Entities/ThrownEnderPearlEntity.cpp
+++ b/src/Entities/ThrownEnderPearlEntity.cpp
@@ -19,7 +19,7 @@ cThrownEnderPearlEntity::cThrownEnderPearlEntity(cEntity * a_Creator, double a_X
-void cThrownEnderPearlEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cThrownEnderPearlEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
// TODO: Tweak a_HitPos based on block face.
TeleportCreator(a_HitPos);
@@ -31,7 +31,7 @@ void cThrownEnderPearlEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockF
-void cThrownEnderPearlEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cThrownEnderPearlEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
int TotalDamage = 0;
// TODO: If entity is Ender Crystal, destroy it
@@ -67,7 +67,7 @@ void cThrownEnderPearlEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Ch
-void cThrownEnderPearlEntity::TeleportCreator(const Vector3d & a_HitPos)
+void cThrownEnderPearlEntity::TeleportCreator(Vector3d a_HitPos)
{
if (m_CreatorData.m_Name.empty())
{
diff --git a/src/Entities/ThrownEnderPearlEntity.h b/src/Entities/ThrownEnderPearlEntity.h
index 03d54e911..ee618f900 100644
--- a/src/Entities/ThrownEnderPearlEntity.h
+++ b/src/Entities/ThrownEnderPearlEntity.h
@@ -33,12 +33,12 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
/** Teleports the creator where the ender pearl lands */
- void TeleportCreator(const Vector3d & a_HitPos);
+ void TeleportCreator(Vector3d a_HitPos);
private:
diff --git a/src/Entities/ThrownSnowballEntity.cpp b/src/Entities/ThrownSnowballEntity.cpp
index ef88bfd18..8a6426ca9 100644
--- a/src/Entities/ThrownSnowballEntity.cpp
+++ b/src/Entities/ThrownSnowballEntity.cpp
@@ -18,7 +18,7 @@ cThrownSnowballEntity::cThrownSnowballEntity(cEntity * a_Creator, double a_X, do
-void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cThrownSnowballEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
m_DestroyTimer = 2;
}
@@ -27,7 +27,7 @@ void cThrownSnowballEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFac
-void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
super::OnHitEntity(a_EntityHit, a_HitPos);
diff --git a/src/Entities/ThrownSnowballEntity.h b/src/Entities/ThrownSnowballEntity.h
index d22930f8f..7bed78df3 100644
--- a/src/Entities/ThrownSnowballEntity.h
+++ b/src/Entities/ThrownSnowballEntity.h
@@ -33,8 +33,8 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
private:
diff --git a/src/Entities/WitherSkullEntity.cpp b/src/Entities/WitherSkullEntity.cpp
index 03385b283..354a08dc6 100644
--- a/src/Entities/WitherSkullEntity.cpp
+++ b/src/Entities/WitherSkullEntity.cpp
@@ -24,7 +24,7 @@ cWitherSkullEntity::cWitherSkullEntity(cEntity * a_Creator, double a_X, double a
-void cWitherSkullEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace)
+void cWitherSkullEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
{
// TODO: Explode
// TODO: Apply wither effect to entities nearby
@@ -35,7 +35,7 @@ void cWitherSkullEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a
-void cWitherSkullEntity::OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos)
+void cWitherSkullEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
{
// TODO: If entity is Ender Crystal, destroy it
a_EntityHit.TakeDamage(dtRangedAttack, this, 0, 1);
diff --git a/src/Entities/WitherSkullEntity.h b/src/Entities/WitherSkullEntity.h
index 11b6fe3aa..af9b31625 100644
--- a/src/Entities/WitherSkullEntity.h
+++ b/src/Entities/WitherSkullEntity.h
@@ -33,8 +33,8 @@ public:
protected:
// cProjectileEntity overrides:
- virtual void OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) override;
- virtual void OnHitEntity(cEntity & a_EntityHit, const Vector3d & a_HitPos) override;
+ virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace) override;
+ virtual void OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos) override;
} ; // tolua_export