Using Super.
This commit is contained in:
committed by
Alexander Harkness
parent
f931590bf0
commit
9ee47e5999
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cArrowEntity::cArrowEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkArrow, a_Creator, a_Pos, 0.5, 0.5),
|
||||
Super(pkArrow, a_Creator, a_Pos, 0.5, 0.5),
|
||||
m_PickupState(psNoPickup),
|
||||
m_DamageCoeff(2),
|
||||
m_IsCritical(false),
|
||||
@@ -35,7 +35,7 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed
|
||||
|
||||
|
||||
cArrowEntity::cArrowEntity(cPlayer & a_Player, double a_Force) :
|
||||
super(pkArrow, &a_Player, a_Player.GetThrowStartPos(), a_Player.GetThrowSpeed(a_Force * 1.5 * 20), 0.5, 0.5),
|
||||
Super(pkArrow, &a_Player, a_Player.GetThrowStartPos(), a_Player.GetThrowSpeed(a_Force * 1.5 * 20), 0.5, 0.5),
|
||||
m_PickupState(psInSurvivalOrCreative),
|
||||
m_DamageCoeff(2),
|
||||
m_IsCritical((a_Force >= 1)),
|
||||
@@ -77,7 +77,7 @@ 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)
|
||||
|
||||
super::OnHitSolidBlock(Hit, a_HitFace);
|
||||
Super::OnHitSolidBlock(Hit, a_HitFace);
|
||||
Vector3i BlockHit = Hit.Floor();
|
||||
|
||||
int X = BlockHit.x, Y = BlockHit.y, Z = BlockHit.z;
|
||||
@@ -100,7 +100,7 @@ void cArrowEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
|
||||
|
||||
void cArrowEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
|
||||
{
|
||||
super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
Super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
|
||||
int Damage = static_cast<int>(GetSpeed().Length() / 20 * m_DamageCoeff + 0.5);
|
||||
if (m_IsCritical)
|
||||
@@ -165,7 +165,7 @@ void cArrowEntity::CollectedBy(cPlayer & a_Dest)
|
||||
|
||||
void cArrowEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -22,7 +22,7 @@ class cArrowEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
// tolua_begin
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
cBoat::cBoat(Vector3d a_Pos, eMaterial a_Material) :
|
||||
super(etBoat, a_Pos, 0.98, 0.7),
|
||||
Super(etBoat, a_Pos, 0.98, 0.7),
|
||||
m_LastDamage(0), m_ForwardDirection(0),
|
||||
m_DamageTaken(0.0f), m_Material(a_Material),
|
||||
m_RightPaddleUsed(false), m_LeftPaddleUsed(false)
|
||||
@@ -72,7 +72,7 @@ void cBoat::BroadcastMovementUpdate(const cClientHandle * a_Exclude)
|
||||
bool cBoat::DoTakeDamage(TakeDamageInfo & TDI)
|
||||
{
|
||||
m_LastDamage = 10;
|
||||
if (!super::DoTakeDamage(TDI))
|
||||
if (!Super::DoTakeDamage(TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ bool cBoat::DoTakeDamage(TakeDamageInfo & TDI)
|
||||
|
||||
void cBoat::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if (m_Attachee != nullptr)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ void cBoat::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
void cBoat::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -15,10 +15,14 @@
|
||||
|
||||
// tolua_begin
|
||||
|
||||
class cBoat :
|
||||
class cBoat:
|
||||
public cEntity
|
||||
{
|
||||
typedef cEntity super;
|
||||
// tolua_end
|
||||
|
||||
using Super = cEntity;
|
||||
|
||||
// tolua_begin
|
||||
|
||||
public:
|
||||
enum eMaterial
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cEnderCrystal::cEnderCrystal(Vector3d a_Pos):
|
||||
super(etEnderCrystal, a_Pos, 1.0, 1.0)
|
||||
Super(etEnderCrystal, a_Pos, 1.0, 1.0)
|
||||
{
|
||||
SetMaxHealth(5);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ void cEnderCrystal::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
void cEnderCrystal::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
|
||||
m_World->DoExplosionAt(6.0, GetPosX(), GetPosY(), GetPosZ(), true, esEnderCrystal, this);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class cEnderCrystal :
|
||||
public cEntity
|
||||
{
|
||||
// tolua_end
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -889,7 +889,7 @@ void cEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
return;
|
||||
}
|
||||
|
||||
// Position changed -> super::Tick() called:
|
||||
// Position changed -> Super::Tick() called:
|
||||
GET_AND_VERIFY_CURRENT_CHUNK(NextChunk, POSX_TOINT, POSZ_TOINT);
|
||||
|
||||
// Set swim states (water, lava, and fire):
|
||||
@@ -941,7 +941,7 @@ void cEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
int BlockY = POSY_TOINT;
|
||||
int BlockZ = POSZ_TOINT;
|
||||
|
||||
// Position changed -> super::HandlePhysics() called
|
||||
// Position changed -> Super::HandlePhysics() called
|
||||
GET_AND_VERIFY_CURRENT_CHUNK(NextChunk, BlockX, BlockZ);
|
||||
|
||||
// TODO Add collision detection with entities.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define CLASS_PROTODEF(classname) \
|
||||
virtual bool IsA(const char * a_ClassName) const override\
|
||||
{ \
|
||||
return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName))); \
|
||||
return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || Super::IsA(a_ClassName))); \
|
||||
} \
|
||||
virtual const char * GetClass(void) const override \
|
||||
{ \
|
||||
@@ -24,7 +24,7 @@
|
||||
} \
|
||||
virtual const char * GetParentClass(void) const override \
|
||||
{ \
|
||||
return super::GetClass(); \
|
||||
return Super::GetClass(); \
|
||||
}
|
||||
|
||||
#define POSX_TOINT FloorC(GetPosX())
|
||||
|
||||
@@ -365,7 +365,7 @@ void cEntityEffectInstantDamage::OnActivate(cPawn & a_Target)
|
||||
|
||||
void cEntityEffectRegeneration::OnTick(cPawn & a_Target)
|
||||
{
|
||||
super::OnTick(a_Target);
|
||||
Super::OnTick(a_Target);
|
||||
|
||||
if (a_Target.IsMob() && static_cast<cMonster &>(a_Target).IsUndead())
|
||||
{
|
||||
@@ -392,7 +392,7 @@ void cEntityEffectRegeneration::OnTick(cPawn & a_Target)
|
||||
|
||||
void cEntityEffectHunger::OnTick(cPawn & a_Target)
|
||||
{
|
||||
super::OnTick(a_Target);
|
||||
Super::OnTick(a_Target);
|
||||
|
||||
if (a_Target.IsPlayer())
|
||||
{
|
||||
@@ -426,7 +426,7 @@ void cEntityEffectInvisibility::BroadcastMetadata(cPawn & a_Target)
|
||||
|
||||
void cEntityEffectWeakness::OnTick(cPawn & a_Target)
|
||||
{
|
||||
super::OnTick(a_Target);
|
||||
Super::OnTick(a_Target);
|
||||
|
||||
// Damage reduction = 0.5 damage, multiplied by potion level (Weakness II = 1 damage)
|
||||
// double dmg_reduc = 0.5 * (a_Effect.GetIntensity() + 1);
|
||||
@@ -444,7 +444,7 @@ void cEntityEffectWeakness::OnTick(cPawn & a_Target)
|
||||
|
||||
void cEntityEffectPoison::OnTick(cPawn & a_Target)
|
||||
{
|
||||
super::OnTick(a_Target);
|
||||
Super::OnTick(a_Target);
|
||||
|
||||
if (a_Target.IsMob())
|
||||
{
|
||||
@@ -483,7 +483,7 @@ void cEntityEffectPoison::OnTick(cPawn & a_Target)
|
||||
|
||||
void cEntityEffectWither::OnTick(cPawn & a_Target)
|
||||
{
|
||||
super::OnTick(a_Target);
|
||||
Super::OnTick(a_Target);
|
||||
|
||||
// Damage frequency = 40 ticks, divided by effect level (Wither II = 20 ticks)
|
||||
int frequency = std::max(1, FloorC(40.0 / static_cast<double>(m_Intensity + 1)));
|
||||
|
||||
@@ -131,10 +131,12 @@ protected:
|
||||
class cEntityEffectSpeed:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectSpeed(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -150,10 +152,12 @@ public:
|
||||
class cEntityEffectSlowness:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectSlowness(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -169,10 +173,12 @@ public:
|
||||
class cEntityEffectHaste:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectHaste(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -184,10 +190,12 @@ public:
|
||||
class cEntityEffectMiningFatigue:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectMiningFatigue(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -199,10 +207,12 @@ public:
|
||||
class cEntityEffectStrength:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectStrength(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -214,10 +224,12 @@ public:
|
||||
class cEntityEffectInstantHealth:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectInstantHealth(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -231,10 +243,12 @@ public:
|
||||
class cEntityEffectInstantDamage:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectInstantDamage(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -248,10 +262,12 @@ public:
|
||||
class cEntityEffectJumpBoost:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectJumpBoost(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -263,10 +279,12 @@ public:
|
||||
class cEntityEffectNausea:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectNausea(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -278,10 +296,12 @@ public:
|
||||
class cEntityEffectRegeneration:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectRegeneration(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -295,10 +315,12 @@ public:
|
||||
class cEntityEffectResistance:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectResistance(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -310,10 +332,12 @@ public:
|
||||
class cEntityEffectFireResistance:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectFireResistance(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -325,10 +349,12 @@ public:
|
||||
class cEntityEffectWaterBreathing:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectWaterBreathing(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -340,10 +366,12 @@ public:
|
||||
class cEntityEffectInvisibility:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectInvisibility(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -361,10 +389,12 @@ private:
|
||||
class cEntityEffectBlindness:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectBlindness(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -376,10 +406,12 @@ public:
|
||||
class cEntityEffectNightVision:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectNightVision(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -391,10 +423,12 @@ public:
|
||||
class cEntityEffectHunger:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectHunger(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -409,10 +443,12 @@ public:
|
||||
class cEntityEffectWeakness:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectWeakness(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -427,10 +463,12 @@ public:
|
||||
class cEntityEffectPoison:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectPoison(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -445,10 +483,12 @@ public:
|
||||
class cEntityEffectWither:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectWither(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -463,10 +503,12 @@ public:
|
||||
class cEntityEffectHealthBoost:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectHealthBoost(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -478,10 +520,12 @@ public:
|
||||
class cEntityEffectAbsorption:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectAbsorption(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
};
|
||||
@@ -493,10 +537,12 @@ public:
|
||||
class cEntityEffectSaturation:
|
||||
public cEntityEffect
|
||||
{
|
||||
typedef cEntityEffect super;
|
||||
using Super = cEntityEffect;
|
||||
|
||||
public:
|
||||
|
||||
cEntityEffectSaturation(int a_Duration, short a_Intensity, double a_DistanceModifier = 1):
|
||||
super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
Super(a_Duration, a_Intensity, a_DistanceModifier)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cExpBottleEntity::cExpBottleEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed) :
|
||||
super(pkExpBottle, a_Creator, a_Pos, 0.25, 0.25)
|
||||
Super(pkExpBottle, a_Creator, a_Pos, 0.25, 0.25)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class cExpBottleEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
cExpOrb::cExpOrb(Vector3d a_Pos, int a_Reward):
|
||||
super(etExpOrb, a_Pos, 0.98, 0.98), // TODO: Check size
|
||||
Super(etExpOrb, a_Pos, 0.98, 0.98), // TODO: Check size
|
||||
m_Reward(a_Reward),
|
||||
m_Timer(0)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return true;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,14 +8,15 @@
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cExpOrb :
|
||||
class cExpOrb:
|
||||
public cEntity
|
||||
{
|
||||
typedef cEntity super;
|
||||
|
||||
public:
|
||||
// tolua_end
|
||||
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
CLASS_PROTODEF(cExpOrb)
|
||||
|
||||
cExpOrb(Vector3d a_Pos, int a_Reward);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
cFallingBlock::cFallingBlock(Vector3d a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta):
|
||||
super(etFallingBlock, a_Position, 0.98, 0.98),
|
||||
Super(etFallingBlock, a_Position, 0.98, 0.98),
|
||||
m_BlockType(a_BlockType),
|
||||
m_BlockMeta(a_BlockMeta)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ class cFallingBlock :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cFireChargeEntity::cFireChargeEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkFireCharge, a_Creator, a_Pos, 0.3125, 0.3125)
|
||||
Super(pkFireCharge, a_Creator, a_Pos, 0.3125, 0.3125)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
SetGravity(0);
|
||||
@@ -43,7 +43,7 @@ void cFireChargeEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
|
||||
|
||||
void cFireChargeEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
|
||||
{
|
||||
super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
Super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
|
||||
Destroy();
|
||||
Explode(a_HitPos.Floor());
|
||||
|
||||
@@ -22,7 +22,7 @@ class cFireChargeEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cFireworkEntity::cFireworkEntity(cEntity * a_Creator, Vector3d a_Pos, const cItem & a_Item) :
|
||||
super(pkFirework, a_Creator, a_Pos, 0.25, 0.25),
|
||||
Super(pkFirework, a_Creator, a_Pos, 0.25, 0.25),
|
||||
m_TicksToExplosion(a_Item.m_FireworkItem.m_FlightTimeInTicks),
|
||||
m_FireworkItem(a_Item)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ void cFireworkEntity::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_C
|
||||
|
||||
void cFireworkEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -22,7 +22,7 @@ class cFireworkEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
|
||||
|
||||
cFloater::cFloater(Vector3d a_Pos, Vector3d a_Speed, UInt32 a_PlayerID, int a_CountDownTime) :
|
||||
super(etFloater, a_Pos, 0.2, 0.2),
|
||||
Super(etFloater, a_Pos, 0.2, 0.2),
|
||||
m_BitePos(a_Pos),
|
||||
m_CanPickupItem(false),
|
||||
m_PickupCountDown(0),
|
||||
|
||||
@@ -13,7 +13,7 @@ class cFloater :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cGhastFireballEntity::cGhastFireballEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkGhastFireball, a_Creator, a_Pos, 1, 1)
|
||||
Super(pkGhastFireball, a_Creator, a_Pos, 1, 1)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
SetGravity(0);
|
||||
|
||||
@@ -22,7 +22,7 @@ class cGhastFireballEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cHangingEntity::cHangingEntity(eEntityType a_EntityType, eBlockFace a_Facing, Vector3d a_Pos) :
|
||||
super(a_EntityType, a_Pos, 0.8, 0.8),
|
||||
Super(a_EntityType, a_Pos, 0.8, 0.8),
|
||||
m_Facing(cHangingEntity::BlockFaceToProtocolFace(a_Facing))
|
||||
{
|
||||
SetMaxHealth(1);
|
||||
|
||||
@@ -13,7 +13,7 @@ class cHangingEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
cItemFrame::cItemFrame(eBlockFace a_BlockFace, Vector3d a_Pos):
|
||||
super(etItemFrame, a_BlockFace, a_Pos),
|
||||
Super(etItemFrame, a_BlockFace, a_Pos),
|
||||
m_Item(E_BLOCK_AIR),
|
||||
m_ItemRotation(0)
|
||||
{
|
||||
@@ -22,7 +22,7 @@ cItemFrame::cItemFrame(eBlockFace a_BlockFace, Vector3d a_Pos):
|
||||
|
||||
void cItemFrame::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if (!m_Item.IsEmpty())
|
||||
{
|
||||
@@ -56,7 +56,7 @@ void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (m_Item.IsEmpty())
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ void cItemFrame::GetDrops(cItems & a_Items, cEntity * a_Killer)
|
||||
|
||||
void cItemFrame::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
super::SpawnOn(a_ClientHandle);
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendSpawnObject(*this, 71, GetProtocolFacing(), static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
|
||||
a_ClientHandle.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class cItemFrame :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cHangingEntity;
|
||||
using Super = cHangingEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
cLeashKnot::cLeashKnot(eBlockFace a_BlockFace, Vector3d a_Pos) :
|
||||
super(etLeashKnot, a_BlockFace, a_Pos),
|
||||
Super(etLeashKnot, a_BlockFace, a_Pos),
|
||||
m_ShouldSelfDestroy(false),
|
||||
m_TicksToSelfDestroy(20 * 1)
|
||||
{
|
||||
@@ -27,7 +27,7 @@ cLeashKnot::cLeashKnot(eBlockFace a_BlockFace, Vector3d a_Pos) :
|
||||
|
||||
void cLeashKnot::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
TiePlayersLeashedMobs(a_Player, true);
|
||||
|
||||
@@ -82,7 +82,7 @@ void cLeashKnot::TiePlayersLeashedMobs(cPlayer & a_Player, bool a_ShouldBroadcas
|
||||
|
||||
void cLeashKnot::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
m_World->BroadcastSoundEffect("entity.leashknot.break", GetPosition(), 1, 1);
|
||||
Destroy();
|
||||
return;
|
||||
@@ -106,7 +106,7 @@ void cLeashKnot::GetDrops(cItems & a_Items, cEntity * a_Killer)
|
||||
|
||||
void cLeashKnot::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
super::SpawnOn(a_ClientHandle);
|
||||
Super::SpawnOn(a_ClientHandle);
|
||||
a_ClientHandle.SendSpawnObject(*this, 77, GetProtocolFacing(), static_cast<Byte>(GetYaw()), static_cast<Byte>(GetPitch()));
|
||||
a_ClientHandle.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class cLeashKnot :
|
||||
public cHangingEntity
|
||||
{
|
||||
// tolua_end
|
||||
using super = cHangingEntity;
|
||||
using Super = cHangingEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ protected:
|
||||
// cMinecart:
|
||||
|
||||
cMinecart::cMinecart(ePayload a_Payload, Vector3d a_Pos):
|
||||
super(etMinecart, a_Pos, 0.98, 0.7),
|
||||
Super(etMinecart, a_Pos, 0.98, 0.7),
|
||||
m_Payload(a_Payload),
|
||||
m_LastDamage(0),
|
||||
m_DetectorRailPosition(0, 0, 0),
|
||||
@@ -132,7 +132,7 @@ void cMinecart::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
if ((PosY <= 0) || (PosY >= cChunkDef::Height))
|
||||
{
|
||||
// Outside the world, just process normal falling physics
|
||||
super::HandlePhysics(a_Dt, a_Chunk);
|
||||
Super::HandlePhysics(a_Dt, a_Chunk);
|
||||
BroadcastMovementUpdate();
|
||||
return;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void cMinecart::HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
// Not on rail, default physics
|
||||
SetPosY(floor(GetPosY()) + 0.35); // HandlePhysics overrides this if minecart can fall, else, it is to stop ground clipping minecart bottom when off-rail
|
||||
super::HandlePhysics(a_Dt, *chunk);
|
||||
Super::HandlePhysics(a_Dt, *chunk);
|
||||
}
|
||||
|
||||
if (m_bIsOnDetectorRail && !Vector3i(POSX_TOINT, POSY_TOINT, POSZ_TOINT).Equals(m_DetectorRailPosition))
|
||||
@@ -1044,11 +1044,11 @@ bool cMinecart::DoTakeDamage(TakeDamageInfo & TDI)
|
||||
Destroy();
|
||||
TDI.FinalDamage = GetMaxHealth(); // Instant hit for creative
|
||||
SetInvulnerableTicks(0);
|
||||
return super::DoTakeDamage(TDI); // No drops for creative
|
||||
return Super::DoTakeDamage(TDI); // No drops for creative
|
||||
}
|
||||
|
||||
m_LastDamage = static_cast<int>(TDI.FinalDamage);
|
||||
if (!super::DoTakeDamage(TDI))
|
||||
if (!Super::DoTakeDamage(TDI))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1145,7 +1145,7 @@ void cMinecart::DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
|
||||
a_SpeedZ = MAX_SPEED_NEGATIVE;
|
||||
}
|
||||
|
||||
super::DoSetSpeed(a_SpeedX, a_SpeedY, a_SpeedZ);
|
||||
Super::DoSetSpeed(a_SpeedX, a_SpeedY, a_SpeedZ);
|
||||
}
|
||||
|
||||
|
||||
@@ -1168,7 +1168,7 @@ void cMinecart::Destroyed()
|
||||
// cRideableMinecart:
|
||||
|
||||
cRideableMinecart::cRideableMinecart(Vector3d a_Pos, const cItem & a_Content, int a_Height):
|
||||
super(mpNone, a_Pos),
|
||||
Super(mpNone, a_Pos),
|
||||
m_Content(a_Content),
|
||||
m_Height(a_Height)
|
||||
{
|
||||
@@ -1180,7 +1180,7 @@ cRideableMinecart::cRideableMinecart(Vector3d a_Pos, const cItem & a_Content, in
|
||||
|
||||
void cRideableMinecart::OnRightClicked(cPlayer & a_Player)
|
||||
{
|
||||
super::OnRightClicked(a_Player);
|
||||
Super::OnRightClicked(a_Player);
|
||||
|
||||
if (m_Attachee != nullptr)
|
||||
{
|
||||
@@ -1213,7 +1213,7 @@ void cRideableMinecart::OnRightClicked(cPlayer & a_Player)
|
||||
// cMinecartWithChest:
|
||||
|
||||
cMinecartWithChest::cMinecartWithChest(Vector3d a_Pos):
|
||||
super(mpChest, a_Pos),
|
||||
Super(mpChest, a_Pos),
|
||||
cEntityWindowOwner(this),
|
||||
m_Contents(ContentsWidth, ContentsHeight)
|
||||
{
|
||||
@@ -1287,7 +1287,7 @@ void cMinecartWithChest::Destroyed()
|
||||
// cMinecartWithFurnace:
|
||||
|
||||
cMinecartWithFurnace::cMinecartWithFurnace(Vector3d a_Pos):
|
||||
super(mpFurnace, a_Pos),
|
||||
Super(mpFurnace, a_Pos),
|
||||
m_FueledTimeLeft(-1),
|
||||
m_IsFueled(false)
|
||||
{
|
||||
@@ -1321,7 +1321,7 @@ void cMinecartWithFurnace::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
void cMinecartWithFurnace::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -1354,7 +1354,7 @@ void cMinecartWithFurnace::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk
|
||||
// cMinecartWithTNT:
|
||||
|
||||
cMinecartWithTNT::cMinecartWithTNT(Vector3d a_Pos):
|
||||
super(mpTNT, a_Pos)
|
||||
Super(mpTNT, a_Pos)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1368,7 +1368,7 @@ cMinecartWithTNT::cMinecartWithTNT(Vector3d a_Pos):
|
||||
// cMinecartWithHopper:
|
||||
|
||||
cMinecartWithHopper::cMinecartWithHopper(Vector3d a_Pos):
|
||||
super(mpHopper, a_Pos)
|
||||
Super(mpHopper, a_Pos)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
class cMinecart :
|
||||
public cEntity
|
||||
{
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public:
|
||||
CLASS_PROTODEF(cMinecart)
|
||||
@@ -97,7 +97,7 @@ protected:
|
||||
class cRideableMinecart :
|
||||
public cMinecart
|
||||
{
|
||||
using super = cMinecart;
|
||||
using Super = cMinecart;
|
||||
|
||||
public:
|
||||
|
||||
@@ -127,7 +127,7 @@ class cMinecartWithChest :
|
||||
public cItemGrid::cListener,
|
||||
public cEntityWindowOwner
|
||||
{
|
||||
using super = cMinecart;
|
||||
using Super = cMinecart;
|
||||
|
||||
public:
|
||||
|
||||
@@ -178,7 +178,7 @@ protected:
|
||||
class cMinecartWithFurnace :
|
||||
public cMinecart
|
||||
{
|
||||
using super = cMinecart;
|
||||
using Super = cMinecart;
|
||||
|
||||
public:
|
||||
|
||||
@@ -211,7 +211,7 @@ private:
|
||||
class cMinecartWithTNT :
|
||||
public cMinecart
|
||||
{
|
||||
using super = cMinecart;
|
||||
using Super = cMinecart;
|
||||
|
||||
public:
|
||||
CLASS_PROTODEF(cMinecartWithTNT)
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
class cMinecartWithHopper :
|
||||
public cMinecart
|
||||
{
|
||||
using super = cMinecart;
|
||||
using Super = cMinecart;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, Vector3d a_Pos):
|
||||
super(etPainting, a_Direction, a_Pos),
|
||||
Super(etPainting, a_Direction, a_Pos),
|
||||
m_Name(a_Name)
|
||||
{
|
||||
}
|
||||
@@ -22,7 +22,7 @@ cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, Vector3d a_
|
||||
|
||||
void cPainting::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
super::SpawnOn(a_Client);
|
||||
Super::SpawnOn(a_Client);
|
||||
a_Client.SendPaintingSpawn(*this);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class cPainting :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cHangingEntity;
|
||||
using Super = cHangingEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
virtual void GetDrops(cItems & a_Items, cEntity * a_Killer) override;
|
||||
virtual void KilledBy(TakeDamageInfo & a_TDI) override
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
|
||||
cPawn::cPawn(eEntityType a_EntityType, double a_Width, double a_Height) :
|
||||
super(a_EntityType, Vector3d(), a_Width, a_Height),
|
||||
Super(a_EntityType, Vector3d(), a_Width, a_Height),
|
||||
m_EntityEffects(tEffectMap()),
|
||||
m_LastGroundHeight(0),
|
||||
m_bTouchGround(false)
|
||||
@@ -40,7 +40,7 @@ cPawn::~cPawn()
|
||||
void cPawn::Destroyed()
|
||||
{
|
||||
StopEveryoneFromTargetingMe();
|
||||
super::Destroyed();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
);
|
||||
}
|
||||
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -130,7 +130,7 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
void cPawn::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
ClearEntityEffects();
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ void cPawn::KilledBy(TakeDamageInfo & a_TDI)
|
||||
|
||||
bool cPawn::IsFireproof(void) const
|
||||
{
|
||||
return super::IsFireproof() || HasEntityEffect(cEntityEffect::effFireResistance);
|
||||
return Super::IsFireproof() || HasEntityEffect(cEntityEffect::effFireResistance);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void cPawn::HandleAir(void)
|
||||
return;
|
||||
}
|
||||
|
||||
super::HandleAir();
|
||||
Super::HandleAir();
|
||||
}
|
||||
|
||||
|
||||
@@ -499,6 +499,6 @@ cEntityEffect * cPawn::GetEntityEffect(cEntityEffect::eType a_EffectType)
|
||||
|
||||
void cPawn::ResetPosition(Vector3d a_NewPosition)
|
||||
{
|
||||
super::ResetPosition(a_NewPosition);
|
||||
Super::ResetPosition(a_NewPosition);
|
||||
m_LastGroundHeight = GetPosY();
|
||||
}
|
||||
|
||||
@@ -12,13 +12,14 @@ class cMonster;
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cPawn :
|
||||
class cPawn:
|
||||
public cEntity
|
||||
{
|
||||
// tolua_end
|
||||
typedef cEntity super;
|
||||
using Super = cEntity;
|
||||
|
||||
public:
|
||||
|
||||
CLASS_PROTODEF(cPawn)
|
||||
|
||||
cPawn(eEntityType a_EntityType, double a_Width, double a_Height);
|
||||
|
||||
@@ -97,7 +97,7 @@ protected:
|
||||
// cPickup:
|
||||
|
||||
cPickup::cPickup(Vector3d a_Pos, const cItem & a_Item, bool IsPlayerCreated, Vector3f a_Speed, int a_LifetimeTicks, bool a_CanCombine):
|
||||
super(etPickup, a_Pos, 0.2, 0.2),
|
||||
Super(etPickup, a_Pos, 0.2, 0.2),
|
||||
m_Timer(0),
|
||||
m_Item(a_Item),
|
||||
m_bCollected(false),
|
||||
@@ -127,7 +127,7 @@ void cPickup::SpawnOn(cClientHandle & a_Client)
|
||||
|
||||
void cPickup::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
@@ -204,7 +204,7 @@ bool cPickup::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
return true;
|
||||
}
|
||||
|
||||
return super::DoTakeDamage(a_TDI);
|
||||
return Super::DoTakeDamage(a_TDI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class cPickup :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ const int cPlayer::EATING_TICKS = 30;
|
||||
|
||||
|
||||
cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) :
|
||||
super(etPlayer, 0.6, 1.8),
|
||||
Super(etPlayer, 0.6, 1.8),
|
||||
m_bVisible(true),
|
||||
m_FoodLevel(MAX_FOOD_LEVEL),
|
||||
m_FoodSaturationLevel(5.0),
|
||||
@@ -227,7 +227,7 @@ cPlayer::~cPlayer(void)
|
||||
void cPlayer::Destroyed()
|
||||
{
|
||||
CloseWindow(false);
|
||||
super::Destroyed();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ void cPlayer::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
|
||||
ASSERT(a_Chunk.IsValid());
|
||||
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
|
||||
// Handle charging the bow:
|
||||
if (m_IsChargingBow)
|
||||
@@ -600,7 +600,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
|
||||
|
||||
void cPlayer::Heal(int a_Health)
|
||||
{
|
||||
super::Heal(a_Health);
|
||||
Super::Heal(a_Health);
|
||||
SendHealth();
|
||||
}
|
||||
|
||||
@@ -1024,7 +1024,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
}
|
||||
}
|
||||
|
||||
if (super::DoTakeDamage(a_TDI))
|
||||
if (Super::DoTakeDamage(a_TDI))
|
||||
{
|
||||
// Any kind of damage adds food exhaustion
|
||||
AddFoodExhaustion(0.3f);
|
||||
@@ -1074,7 +1074,7 @@ void cPlayer::NotifyNearbyWolves(cPawn * a_Opponent, bool a_IsPlayerInvolved)
|
||||
|
||||
void cPlayer::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
Super::KilledBy(a_TDI);
|
||||
|
||||
if (m_Health > 0)
|
||||
{
|
||||
@@ -1766,7 +1766,7 @@ void cPlayer::DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
|
||||
// Do not set speed to a frozen client
|
||||
return;
|
||||
}
|
||||
super::DoSetSpeed(a_SpeedX, a_SpeedY, a_SpeedZ);
|
||||
Super::DoSetSpeed(a_SpeedX, a_SpeedY, a_SpeedZ);
|
||||
// Send the speed to the client so he actualy moves
|
||||
m_ClientHandle->SendEntityVelocity(*this);
|
||||
}
|
||||
@@ -2878,7 +2878,7 @@ void cPlayer::AttachTo(cEntity * a_AttachTo)
|
||||
return;
|
||||
}
|
||||
|
||||
super::AttachTo(a_AttachTo);
|
||||
Super::AttachTo(a_AttachTo);
|
||||
}
|
||||
|
||||
|
||||
@@ -2902,7 +2902,7 @@ void cPlayer::Detach()
|
||||
return;
|
||||
}
|
||||
|
||||
super::Detach();
|
||||
Super::Detach();
|
||||
int PosX = POSX_TOINT;
|
||||
int PosY = POSY_TOINT;
|
||||
int PosZ = POSZ_TOINT;
|
||||
@@ -3099,7 +3099,7 @@ float cPlayer::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_Ex
|
||||
return 0; // No impact from explosion
|
||||
}
|
||||
|
||||
return super::GetExplosionExposureRate(a_ExplosionPosition, a_ExlosionPower) / 30.0f;
|
||||
return Super::GetExplosionExposureRate(a_ExplosionPosition, a_ExlosionPower) / 30.0f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,12 +24,18 @@ class cTeam;
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cPlayer :
|
||||
class cPlayer:
|
||||
public cPawn
|
||||
{
|
||||
typedef cPawn super;
|
||||
|
||||
// tolua_end
|
||||
|
||||
using Super = cPawn;
|
||||
|
||||
// tolua_begin
|
||||
|
||||
public:
|
||||
|
||||
static const int MAX_HEALTH;
|
||||
|
||||
static const int MAX_FOOD_LEVEL;
|
||||
|
||||
@@ -226,7 +226,7 @@ protected:
|
||||
// cProjectileEntity:
|
||||
|
||||
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, double a_Width, double a_Height):
|
||||
super(etProjectile, a_Pos, a_Width, a_Height),
|
||||
Super(etProjectile, a_Pos, a_Width, a_Height),
|
||||
m_ProjectileKind(a_Kind),
|
||||
m_CreatorData(
|
||||
((a_Creator != nullptr) ? a_Creator->GetUniqueID() : cEntity::INVALID_ID),
|
||||
@@ -244,7 +244,7 @@ cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d
|
||||
|
||||
|
||||
cProjectileEntity::cProjectileEntity(eKind a_Kind, cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed, double a_Width, double a_Height):
|
||||
super(etProjectile, a_Pos, a_Width, a_Height),
|
||||
Super(etProjectile, a_Pos, a_Width, a_Height),
|
||||
m_ProjectileKind(a_Kind),
|
||||
m_CreatorData(a_Creator->GetUniqueID(), a_Creator->IsPlayer() ? static_cast<cPlayer *>(a_Creator)->GetName() : "", a_Creator->GetEquippedWeapon().m_Enchantments),
|
||||
m_IsInGround(false)
|
||||
@@ -370,7 +370,7 @@ AString cProjectileEntity::GetMCAClassName(void) const
|
||||
|
||||
void cProjectileEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -22,7 +22,7 @@ class cProjectileEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cEntity;
|
||||
using Super = cEntity;
|
||||
|
||||
// tolua_begin
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ cSplashPotionEntity::cSplashPotionEntity(
|
||||
Vector3d a_Speed,
|
||||
const cItem & a_Item
|
||||
):
|
||||
super(pkSplashPotion, a_Creator, a_Pos, 0.25, 0.25),
|
||||
Super(pkSplashPotion, a_Creator, a_Pos, 0.25, 0.25),
|
||||
m_Item(a_Item),
|
||||
m_DestroyTimer(-1)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ class cSplashPotionEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
@@ -76,7 +76,7 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
|
||||
super(etTNT, a_Pos, 0.98, 0.98),
|
||||
Super(etTNT, a_Pos, 0.98, 0.98),
|
||||
m_FuseTicks(a_FuseTicks)
|
||||
{
|
||||
SetGravity(-16.0f);
|
||||
@@ -45,7 +45,7 @@ void cTNTEntity::Explode(void)
|
||||
|
||||
void cTNTEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
if (!IsTicking())
|
||||
{
|
||||
// The base class tick destroyed us
|
||||
|
||||
@@ -7,13 +7,16 @@
|
||||
|
||||
|
||||
// tolua_begin
|
||||
class cTNTEntity :
|
||||
class cTNTEntity:
|
||||
public cEntity
|
||||
{
|
||||
typedef cEntity super;
|
||||
|
||||
public:
|
||||
// tolua_end
|
||||
|
||||
using Super = cEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
CLASS_PROTODEF(cTNTEntity)
|
||||
|
||||
cTNTEntity(Vector3d a_Pos, int a_FuseTicks = 80);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cThrownEggEntity::cThrownEggEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkEgg, a_Creator, a_Pos, 0.25, 0.25),
|
||||
Super(pkEgg, a_Creator, a_Pos, 0.25, 0.25),
|
||||
m_DestroyTimer(-1)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
@@ -64,7 +64,7 @@ void cThrownEggEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
}
|
||||
else
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class cThrownEggEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
cThrownEnderPearlEntity::cThrownEnderPearlEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkEnderPearl, a_Creator, a_Pos, 0.25, 0.25),
|
||||
Super(pkEnderPearl, a_Creator, a_Pos, 0.25, 0.25),
|
||||
m_DestroyTimer(-1)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
@@ -59,7 +59,7 @@ void cThrownEnderPearlEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Ch
|
||||
}
|
||||
else
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class cThrownEnderPearlEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cThrownSnowballEntity::cThrownSnowballEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkSnowball, a_Creator, a_Pos, 0.25, 0.25),
|
||||
Super(pkSnowball, a_Creator, a_Pos, 0.25, 0.25),
|
||||
m_DestroyTimer(-1)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
@@ -29,7 +29,7 @@ void cThrownSnowballEntity::OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitF
|
||||
|
||||
void cThrownSnowballEntity::OnHitEntity(cEntity & a_EntityHit, Vector3d a_HitPos)
|
||||
{
|
||||
super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
Super::OnHitEntity(a_EntityHit, a_HitPos);
|
||||
|
||||
int TotalDamage = 0;
|
||||
if (a_EntityHit.IsMob())
|
||||
@@ -63,7 +63,7 @@ void cThrownSnowballEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chun
|
||||
}
|
||||
else
|
||||
{
|
||||
super::Tick(a_Dt, a_Chunk);
|
||||
Super::Tick(a_Dt, a_Chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class cThrownSnowballEntity :
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
cWitherSkullEntity::cWitherSkullEntity(cEntity * a_Creator, Vector3d a_Pos, Vector3d a_Speed):
|
||||
super(pkWitherSkull, a_Creator, a_Pos, 0.25, 0.25)
|
||||
Super(pkWitherSkull, a_Creator, a_Pos, 0.25, 0.25)
|
||||
{
|
||||
SetSpeed(a_Speed);
|
||||
SetGravity(0);
|
||||
|
||||
@@ -22,7 +22,7 @@ public cProjectileEntity
|
||||
{
|
||||
// tolua_end
|
||||
|
||||
using super = cProjectileEntity;
|
||||
using Super = cProjectileEntity;
|
||||
|
||||
public: // tolua_export
|
||||
|
||||
|
||||
Reference in New Issue
Block a user