summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-05-02 09:50:36 +0200
committerGitHub <noreply@github.com>2018-05-02 09:50:36 +0200
commita4dbb5c58270959884c17d720185da06464fa256 (patch)
tree2b4e81410e90e059f51726e6c9a01c03fcbfb98d /src/Entities/Entity.cpp
parenttolua++ bindings use nullptr. (#4219) (diff)
downloadcuberite-a4dbb5c58270959884c17d720185da06464fa256.tar
cuberite-a4dbb5c58270959884c17d720185da06464fa256.tar.gz
cuberite-a4dbb5c58270959884c17d720185da06464fa256.tar.bz2
cuberite-a4dbb5c58270959884c17d720185da06464fa256.tar.lz
cuberite-a4dbb5c58270959884c17d720185da06464fa256.tar.xz
cuberite-a4dbb5c58270959884c17d720185da06464fa256.tar.zst
cuberite-a4dbb5c58270959884c17d720185da06464fa256.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 73749d7a3..d1fdcfd39 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -410,7 +410,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
if ((a_TDI.Attacker != nullptr) && (a_TDI.Attacker->IsPlayer()))
{
- cPlayer * Player = reinterpret_cast<cPlayer *>(a_TDI.Attacker);
+ cPlayer * Player = static_cast<cPlayer *>(a_TDI.Attacker);
Player->GetEquippedItem().GetHandler()->OnEntityAttack(Player, this);
@@ -441,7 +441,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
{
if (IsMob())
{
- cMonster * Monster = reinterpret_cast<cMonster *>(this);
+ cMonster * Monster = static_cast<cMonster *>(this);
switch (Monster->GetMobType())
{
case mtSkeleton:
@@ -460,7 +460,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
{
if (IsMob())
{
- cMonster * Monster = reinterpret_cast<cMonster *>(this);
+ cMonster * Monster = static_cast<cMonster *>(this);
switch (Monster->GetMobType())
{
case mtSpider:
@@ -496,7 +496,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
}
else if (IsMob() && !IsInWater())
{
- cMonster * Monster = reinterpret_cast<cMonster *>(this);
+ cMonster * Monster = static_cast<cMonster *>(this);
switch (Monster->GetMobType())
{
case mtGhast:
@@ -871,7 +871,7 @@ void cEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
// Handle cactus damage or destruction:
if (
IsMob() || IsPickup() ||
- (IsPlayer() && !((reinterpret_cast<cPlayer *>(this))->IsGameModeCreative() || (reinterpret_cast<cPlayer *>(this))->IsGameModeSpectator()))
+ (IsPlayer() && !((static_cast<cPlayer *>(this))->IsGameModeCreative() || (static_cast<cPlayer *>(this))->IsGameModeSpectator()))
)
{
DetectCacti();
@@ -1362,7 +1362,7 @@ bool cEntity::DetectPortal()
return false;
}
- if (IsPlayer() && !(reinterpret_cast<cPlayer *>(this))->IsGameModeCreative() && (m_PortalCooldownData.m_TicksDelayed != 80))
+ if (IsPlayer() && !(static_cast<cPlayer *>(this))->IsGameModeCreative() && (m_PortalCooldownData.m_TicksDelayed != 80))
{
// Delay teleportation for four seconds if the entity is a non-creative player
m_PortalCooldownData.m_TicksDelayed++;
@@ -1385,7 +1385,7 @@ bool cEntity::DetectPortal()
if (IsPlayer())
{
// Send a respawn packet before world is loaded / generated so the client isn't left in limbo
- (reinterpret_cast<cPlayer *>(this))->GetClientHandle()->SendRespawn(DestionationDim);
+ (static_cast<cPlayer *>(this))->GetClientHandle()->SendRespawn(DestionationDim);
}
Vector3d TargetPos = GetPosition();
@@ -1414,10 +1414,10 @@ bool cEntity::DetectPortal()
{
if (DestionationDim == dimNether)
{
- reinterpret_cast<cPlayer *>(this)->AwardAchievement(achEnterPortal);
+ static_cast<cPlayer *>(this)->AwardAchievement(achEnterPortal);
}
- reinterpret_cast<cPlayer *>(this)->GetClientHandle()->SendRespawn(DestionationDim);
+ static_cast<cPlayer *>(this)->GetClientHandle()->SendRespawn(DestionationDim);
}
Vector3d TargetPos = GetPosition();
@@ -1454,7 +1454,7 @@ bool cEntity::DetectPortal()
if (IsPlayer())
{
- cPlayer * Player = reinterpret_cast<cPlayer *>(this);
+ cPlayer * Player = static_cast<cPlayer *>(this);
if (Player->GetBedWorld() == DestinationWorld)
{
Player->TeleportToCoords(Player->GetLastBedPos().x, Player->GetLastBedPos().y, Player->GetLastBedPos().z);
@@ -1487,9 +1487,9 @@ bool cEntity::DetectPortal()
{
if (DestionationDim == dimEnd)
{
- reinterpret_cast<cPlayer *>(this)->AwardAchievement(achEnterTheEnd);
+ static_cast<cPlayer *>(this)->AwardAchievement(achEnterTheEnd);
}
- reinterpret_cast<cPlayer *>(this)->GetClientHandle()->SendRespawn(DestionationDim);
+ static_cast<cPlayer *>(this)->GetClientHandle()->SendRespawn(DestionationDim);
}
cWorld * TargetWorld = cRoot::Get()->GetWorld(GetWorld()->GetLinkedEndWorldName());
@@ -1717,7 +1717,7 @@ void cEntity::HandleAir(void)
if (RespirationLevel > 0)
{
- reinterpret_cast<cPawn *>(this)->AddEntityEffect(cEntityEffect::effNightVision, 200, 5, 0);
+ static_cast<cPawn *>(this)->AddEntityEffect(cEntityEffect::effNightVision, 200, 5, 0);
}
if (m_AirLevel <= 0)