CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// tolua_begin
|
||||
|
||||
class cArrowEntity :
|
||||
|
||||
@@ -29,6 +29,7 @@ cBoat::cBoat(Vector3d a_Pos, eMaterial a_Material) :
|
||||
|
||||
|
||||
|
||||
|
||||
void cBoat::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
a_ClientHandle.SendSpawnVehicle(*this, 1);
|
||||
@@ -153,6 +154,7 @@ void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
|
||||
|
||||
|
||||
|
||||
|
||||
void cBoat::SetLastDamage(int TimeSinceLastHit)
|
||||
{
|
||||
m_LastDamage = TimeSinceLastHit;
|
||||
|
||||
@@ -185,6 +185,7 @@ void cEntity::WrapHeadYaw(void)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::WrapRotation(void)
|
||||
{
|
||||
m_Rot.x = NormalizeAngleDegrees(m_Rot.x);
|
||||
@@ -194,6 +195,7 @@ void cEntity::WrapRotation(void)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::WrapSpeed(void)
|
||||
{
|
||||
m_Speed.x = Clamp(m_Speed.x, -78.0, 78.0);
|
||||
@@ -264,7 +266,6 @@ void cEntity::DestroyNoScheduling(bool a_ShouldBroadcast)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::TakeDamage(cEntity & a_Attacker)
|
||||
{
|
||||
int RawDamage = a_Attacker.GetRawDamageAgainst(*this);
|
||||
@@ -590,6 +591,7 @@ int cEntity::GetRawDamageAgainst(const cEntity & a_Receiver)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::ApplyArmorDamage(int DamageBlocked)
|
||||
{
|
||||
// cEntities don't necessarily have armor to damage.
|
||||
@@ -681,7 +683,6 @@ int cEntity::GetEnchantmentCoverAgainst(const cEntity * a_Attacker, eDamageType
|
||||
|
||||
|
||||
|
||||
|
||||
float cEntity::GetEnchantmentBlastKnockbackReduction()
|
||||
{
|
||||
UInt32 MaxLevel = 0;
|
||||
@@ -707,7 +708,6 @@ float cEntity::GetEnchantmentBlastKnockbackReduction()
|
||||
|
||||
|
||||
|
||||
|
||||
int cEntity::GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_Damage)
|
||||
{
|
||||
// Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover
|
||||
@@ -1323,6 +1323,7 @@ void cEntity::DetectCacti(void)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown, bool a_ShouldSendRespawn)
|
||||
{
|
||||
m_NewWorld = a_World;
|
||||
@@ -1335,6 +1336,7 @@ void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool
|
||||
|
||||
|
||||
|
||||
|
||||
bool cEntity::DetectPortal()
|
||||
{
|
||||
// If somebody scheduled a world change with ScheduleMoveToWorld, change worlds now.
|
||||
@@ -1961,6 +1963,7 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude)
|
||||
|
||||
|
||||
|
||||
|
||||
cEntity * cEntity::GetAttached()
|
||||
{
|
||||
return m_AttachedTo;
|
||||
@@ -2107,6 +2110,7 @@ void cEntity::SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::SetSpeedX(double a_SpeedX)
|
||||
{
|
||||
SetSpeed(a_SpeedX, m_Speed.y, m_Speed.z);
|
||||
@@ -2115,6 +2119,7 @@ void cEntity::SetSpeedX(double a_SpeedX)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::SetSpeedY(double a_SpeedY)
|
||||
{
|
||||
SetSpeed(m_Speed.x, a_SpeedY, m_Speed.z);
|
||||
@@ -2123,6 +2128,7 @@ void cEntity::SetSpeedY(double a_SpeedY)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::SetSpeedZ(double a_SpeedZ)
|
||||
{
|
||||
SetSpeed(m_Speed.x, m_Speed.y, a_SpeedZ);
|
||||
@@ -2140,6 +2146,7 @@ void cEntity::SetWidth(double a_Width)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ)
|
||||
{
|
||||
DoSetSpeed(m_Speed.x + a_AddSpeedX, m_Speed.y + a_AddSpeedY, m_Speed.z + a_AddSpeedZ);
|
||||
@@ -2248,6 +2255,7 @@ void cEntity::AddLeashedMob(cMonster * a_Monster)
|
||||
|
||||
|
||||
|
||||
|
||||
void cEntity::RemoveLeashedMob(cMonster * a_Monster)
|
||||
{
|
||||
ASSERT(a_Monster->GetLeashedTo() == this);
|
||||
@@ -2262,7 +2270,6 @@ void cEntity::RemoveLeashedMob(cMonster * a_Monster)
|
||||
|
||||
|
||||
|
||||
|
||||
float cEntity::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower)
|
||||
{
|
||||
double EntitySize = m_Width * m_Width * m_Height;
|
||||
|
||||
@@ -82,6 +82,10 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (a_TDI.DamageType == dtCactusContact)
|
||||
|
||||
@@ -52,7 +52,6 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player)
|
||||
|
||||
|
||||
|
||||
|
||||
void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
if (m_Item.IsEmpty())
|
||||
|
||||
@@ -80,7 +80,6 @@ void cLeashKnot::TiePlayersLeashedMobs(cPlayer & a_Player, bool a_ShouldBroadcas
|
||||
|
||||
|
||||
|
||||
|
||||
void cLeashKnot::KilledBy(TakeDamageInfo & a_TDI)
|
||||
{
|
||||
super::KilledBy(a_TDI);
|
||||
@@ -115,6 +114,7 @@ void cLeashKnot::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
|
||||
|
||||
|
||||
|
||||
void cLeashKnot::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
|
||||
{
|
||||
m_TicksAlive++;
|
||||
|
||||
@@ -109,6 +109,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
|
||||
|
||||
|
||||
|
||||
|
||||
void cMinecart::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
a_ClientHandle.SendSpawnVehicle(*this, 10, static_cast<char>(m_Payload)); // 10 = Minecarts
|
||||
@@ -403,6 +404,7 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::millisecon
|
||||
|
||||
|
||||
|
||||
|
||||
void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
|
||||
{
|
||||
// If the rail is powered set to speed up else slow down.
|
||||
@@ -580,6 +582,7 @@ void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::mi
|
||||
|
||||
|
||||
|
||||
|
||||
void cMinecart::HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt)
|
||||
{
|
||||
HandleRailPhysics(a_RailMeta & 0x07, a_Dt);
|
||||
@@ -869,6 +872,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
|
||||
|
||||
|
||||
|
||||
|
||||
bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
|
||||
{
|
||||
cMinecartCollisionCallback MinecartCollisionCallback(
|
||||
|
||||
@@ -20,7 +20,6 @@ cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, double a_X,
|
||||
|
||||
|
||||
|
||||
|
||||
void cPainting::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
super::SpawnOn(a_Client);
|
||||
|
||||
@@ -984,6 +984,7 @@ void cPlayer::SetFlying(bool a_IsFlying)
|
||||
|
||||
|
||||
|
||||
|
||||
void cPlayer::ApplyArmorDamage(int a_DamageBlocked)
|
||||
{
|
||||
short ArmorDamage = static_cast<short>(std::max(a_DamageBlocked / 4, 1));
|
||||
@@ -1247,6 +1248,7 @@ double cPlayer::GetEyeHeight(void) const
|
||||
|
||||
|
||||
|
||||
|
||||
Vector3d cPlayer::GetEyePosition(void) const
|
||||
{
|
||||
return Vector3d( GetPosX(), m_Stance, GetPosZ());
|
||||
@@ -1282,6 +1284,7 @@ bool cPlayer::IsGameModeAdventure(void) const
|
||||
|
||||
|
||||
|
||||
|
||||
bool cPlayer::IsGameModeSpectator(void) const
|
||||
{
|
||||
return (GetEffectiveGameMode() == gmSpectator);
|
||||
@@ -2979,6 +2982,7 @@ void cPlayer::FreezeInternal(const Vector3d & a_Location, bool a_ManuallyFrozen)
|
||||
|
||||
|
||||
|
||||
|
||||
float cPlayer::GetLiquidHeightPercent(NIBBLETYPE a_Meta)
|
||||
{
|
||||
if (a_Meta >= 8)
|
||||
@@ -3073,7 +3077,6 @@ float cPlayer::GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block)
|
||||
|
||||
|
||||
|
||||
|
||||
float cPlayer::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower)
|
||||
{
|
||||
if (
|
||||
|
||||
@@ -19,6 +19,7 @@ cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
|
||||
|
||||
|
||||
|
||||
|
||||
void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle)
|
||||
{
|
||||
a_ClientHandle.SendSpawnObject(*this, 50, 1, 0, 0); // 50 means TNT
|
||||
|
||||
Reference in New Issue
Block a user