1
0

Sorted a few constructors to remove warnings.

This commit is contained in:
madmaxoft 2013-12-20 16:39:20 +01:00
parent eabb88eb74
commit d6de11da07
10 changed files with 57 additions and 49 deletions

View File

@ -33,23 +33,19 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
, m_Attachee(NULL) , m_Attachee(NULL)
, m_Referencers(new cReferenceManager(cReferenceManager::RFMNGR_REFERENCERS)) , m_Referencers(new cReferenceManager(cReferenceManager::RFMNGR_REFERENCERS))
, m_References(new cReferenceManager(cReferenceManager::RFMNGR_REFERENCES)) , m_References(new cReferenceManager(cReferenceManager::RFMNGR_REFERENCES))
, m_HeadYaw( 0.0 )
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
, m_Mass (0.001) //Default 1g
, m_bDirtyHead(true) , m_bDirtyHead(true)
, m_bDirtyOrientation(true) , m_bDirtyOrientation(true)
, m_bDirtyPosition(true) , m_bDirtyPosition(true)
, m_bDirtySpeed(true) , m_bDirtySpeed(true)
, m_bOnGround( false ) , m_bOnGround( false )
, m_Gravity( -9.81f ) , m_Gravity( -9.81f )
, m_IsInitialized(false)
, m_LastPosX( 0.0 ) , m_LastPosX( 0.0 )
, m_LastPosY( 0.0 ) , m_LastPosY( 0.0 )
, m_LastPosZ( 0.0 ) , m_LastPosZ( 0.0 )
, m_TimeLastTeleportPacket(0) , m_TimeLastTeleportPacket(0)
, m_TimeLastMoveReltPacket(0) , m_TimeLastMoveReltPacket(0)
, m_TimeLastSpeedPacket(0) , m_TimeLastSpeedPacket(0)
, m_IsInitialized(false)
, m_EntityType(a_EntityType) , m_EntityType(a_EntityType)
, m_World(NULL) , m_World(NULL)
, m_TicksSinceLastBurnDamage(0) , m_TicksSinceLastBurnDamage(0)
@ -57,6 +53,10 @@ cEntity::cEntity(eEntityType a_EntityType, double a_X, double a_Y, double a_Z, d
, m_TicksSinceLastFireDamage(0) , m_TicksSinceLastFireDamage(0)
, m_TicksSinceLastVoidDamage(0) , m_TicksSinceLastVoidDamage(0)
, m_TicksLeftBurning(0) , m_TicksLeftBurning(0)
, m_HeadYaw( 0.0 )
, m_Rot(0.0, 0.0, 0.0)
, m_Pos(a_X, a_Y, a_Z)
, m_Mass (0.001) //Default 1g
, m_WaterSpeed(0, 0, 0) , m_WaterSpeed(0, 0, 0)
, m_Width(a_Width) , m_Width(a_Width)
, m_Height(a_Height) , m_Height(a_Height)

View File

@ -36,13 +36,15 @@
cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName) cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
: super(etPlayer, 0.6, 1.8) : super(etPlayer, 0.6, 1.8)
, m_GameMode(eGameMode_NotSet)
, m_IP("")
, m_LastBlockActionTime( 0 )
, m_LastBlockActionCnt( 0 )
, m_AirLevel( MAX_AIR_LEVEL ) , m_AirLevel( MAX_AIR_LEVEL )
, m_AirTickTimer(DROWNING_TICKS) , m_AirTickTimer(DROWNING_TICKS)
, m_bVisible(true) , m_bVisible(true)
, m_FoodLevel(MAX_FOOD_LEVEL)
, m_FoodSaturationLevel(5)
, m_FoodTickTimer(0)
, m_FoodExhaustionLevel(0)
, m_FoodPoisonedTicksRemaining(0)
, m_LastJumpHeight(0)
, m_LastGroundHeight(0) , m_LastGroundHeight(0)
, m_bTouchGround(false) , m_bTouchGround(false)
, m_Stance(0.0) , m_Stance(0.0)
@ -51,28 +53,27 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
, m_InventoryWindow(NULL) , m_InventoryWindow(NULL)
, m_TimeLastPickupCheck(0.f) , m_TimeLastPickupCheck(0.f)
, m_Color('-') , m_Color('-')
, m_LastBlockActionTime(0)
, m_LastBlockActionCnt(0)
, m_GameMode(eGameMode_NotSet)
, m_IP("")
, m_ClientHandle(a_Client) , m_ClientHandle(a_Client)
, m_FoodLevel(MAX_FOOD_LEVEL)
, m_FoodSaturationLevel(5)
, m_FoodTickTimer(0)
, m_FoodExhaustionLevel(0)
, m_FoodPoisonedTicksRemaining(0)
, m_NormalMaxSpeed(0.1) , m_NormalMaxSpeed(0.1)
, m_SprintingMaxSpeed(0.13) , m_SprintingMaxSpeed(0.13)
, m_IsCrouched(false) , m_IsCrouched(false)
, m_IsSprinting(false) , m_IsSprinting(false)
, m_IsFlying(false)
, m_IsSwimming(false) , m_IsSwimming(false)
, m_IsSubmerged(false) , m_IsSubmerged(false)
, m_IsFlying(false)
, m_CanFly(false)
, m_IsFishing(false) , m_IsFishing(false)
, m_FloaterID(-1) , m_CanFly(false)
, m_EatingFinishTick(-1) , m_EatingFinishTick(-1)
, m_LifetimeTotalXp(0)
, m_CurrentXp(0)
, m_bDirtyExperience(false)
, m_IsChargingBow(false) , m_IsChargingBow(false)
, m_BowCharge(0) , m_BowCharge(0)
, m_CurrentXp(0) , m_FloaterID(-1)
, m_LifetimeTotalXp(0)
, m_bDirtyExperience(false)
{ {
LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d", LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d",
a_PlayerName.c_str(), a_Client->GetIPString().c_str(), a_PlayerName.c_str(), a_Client->GetIPString().c_str(),

View File

@ -407,9 +407,6 @@ protected:
float m_TimeLastPickupCheck; float m_TimeLastPickupCheck;
void ResolvePermissions();
void ResolveGroups();
char m_Color; char m_Color;
float m_LastBlockActionTime; float m_LastBlockActionTime;
@ -417,6 +414,7 @@ protected:
eGameMode m_GameMode; eGameMode m_GameMode;
std::string m_IP; std::string m_IP;
/// The item being dragged by the cursor while in a UI window
cItem m_DraggingItem; cItem m_DraggingItem;
long long m_LastPlayerListTime; long long m_LastPlayerListTime;
@ -456,6 +454,11 @@ protected:
int m_FloaterID; int m_FloaterID;
void ResolvePermissions(void);
void ResolveGroups(void);
virtual void Destroyed(void); virtual void Destroyed(void);
/// Filters out damage for creative mode /// Filters out damage for creative mode

View File

@ -396,9 +396,9 @@ cArrowEntity::cArrowEntity(cEntity * a_Creator, double a_X, double a_Y, double a
m_DamageCoeff(2), m_DamageCoeff(2),
m_IsCritical(false), m_IsCritical(false),
m_Timer(0), m_Timer(0),
m_HitGroundTimer(0),
m_bIsCollected(false), m_bIsCollected(false),
m_HitBlockPos(Vector3i(0, 0, 0)), m_HitBlockPos(Vector3i(0, 0, 0))
m_HitGroundTimer(0)
{ {
SetSpeed(a_Speed); SetSpeed(a_Speed);
SetMass(0.1); SetMass(0.1);

View File

@ -68,9 +68,12 @@ static const struct
cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height)
: super(etMonster, a_Width, a_Height) : super(etMonster, a_Width, a_Height)
, m_EMState(IDLE)
, m_EMPersonality(AGGRESSIVE)
, m_SightDistance(25)
, m_Target(NULL) , m_Target(NULL)
, m_AttackRate(3) , m_AttackRate(3)
, idle_interval(0) , m_IdleInterval(0)
, m_bMovingToDestination(false) , m_bMovingToDestination(false)
, m_DestinationTime( 0 ) , m_DestinationTime( 0 )
, m_DestroyTimer( 0 ) , m_DestroyTimer( 0 )
@ -78,10 +81,7 @@ cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString
, m_MobType(a_MobType) , m_MobType(a_MobType)
, m_SoundHurt(a_SoundHurt) , m_SoundHurt(a_SoundHurt)
, m_SoundDeath(a_SoundDeath) , m_SoundDeath(a_SoundDeath)
, m_EMState(IDLE)
, m_SightDistance(25)
, m_SeePlayerInterval (0) , m_SeePlayerInterval (0)
, m_EMPersonality(AGGRESSIVE)
, m_AttackDamage(1.0f) , m_AttackDamage(1.0f)
, m_AttackRange(2.0f) , m_AttackRange(2.0f)
, m_AttackInterval(0) , m_AttackInterval(0)
@ -435,13 +435,13 @@ void cMonster::EventLosePlayer(void)
// What to do if in Idle State // What to do if in Idle State
void cMonster::InStateIdle(float a_Dt) void cMonster::InStateIdle(float a_Dt)
{ {
idle_interval += a_Dt; m_IdleInterval += a_Dt;
if (idle_interval > 1) if (m_IdleInterval > 1)
{ {
// at this interval the results are predictable // at this interval the results are predictable
int rem = m_World->GetTickRandomNumber(6) + 1; int rem = m_World->GetTickRandomNumber(6) + 1;
// LOGD("Moving: int: %3.3f rem: %i",idle_interval,rem); // LOGD("Moving: int: %3.3f rem: %i",idle_interval,rem);
idle_interval -= 1; // So nothing gets dropped when the server hangs for a few seconds m_IdleInterval -= 1; // So nothing gets dropped when the server hangs for a few seconds
Vector3f Dist; Vector3f Dist;
Dist.x = (float)(m_World->GetTickRandomNumber(10) - 5); Dist.x = (float)(m_World->GetTickRandomNumber(10) - 5);
Dist.z = (float)(m_World->GetTickRandomNumber(10) - 5); Dist.z = (float)(m_World->GetTickRandomNumber(10) - 5);

View File

@ -161,7 +161,7 @@ protected:
cEntity * m_Target; cEntity * m_Target;
float m_AttackRate; float m_AttackRate;
float idle_interval; float m_IdleInterval;
Vector3f m_Destination; Vector3f m_Destination;
bool m_bMovingToDestination; bool m_bMovingToDestination;

View File

@ -11,10 +11,10 @@
cWolf::cWolf(void) : cWolf::cWolf(void) :
super("Wolf", mtWolf, "mob.wolf.hurt", "mob.wolf.death", 0.6, 0.8), super("Wolf", mtWolf, "mob.wolf.hurt", "mob.wolf.death", 0.6, 0.8),
m_IsAngry(false),
m_IsTame(false),
m_IsSitting(false), m_IsSitting(false),
m_IsTame(false),
m_IsBegging(false), m_IsBegging(false),
m_IsAngry(false),
m_OwnerName(""), m_OwnerName(""),
m_CollarColor(14) m_CollarColor(14)
{ {

View File

@ -8,10 +8,11 @@
cZombie::cZombie(bool IsVillagerZombie) :
cZombie::cZombie(bool a_IsVillagerZombie) :
super("Zombie", mtZombie, "mob.zombie.hurt", "mob.zombie.death", 0.6, 1.8), super("Zombie", mtZombie, "mob.zombie.hurt", "mob.zombie.death", 0.6, 1.8),
m_bIsConverting(false), m_IsConverting(false),
m_bIsVillagerZombie(IsVillagerZombie) m_IsVillagerZombie(a_IsVillagerZombie)
{ {
SetBurnsInDaylight(true); SetBurnsInDaylight(true);
} }
@ -45,3 +46,5 @@ void cZombie::MoveToPosition(const Vector3f & a_Position)
} }

View File

@ -12,19 +12,20 @@ class cZombie :
typedef cAggressiveMonster super; typedef cAggressiveMonster super;
public: public:
cZombie(bool IsVillagerZombie); cZombie(bool a_IsVillagerZombie);
CLASS_PROTODEF(cZombie); CLASS_PROTODEF(cZombie);
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3f & a_Position) override; virtual void MoveToPosition(const Vector3f & a_Position) override;
bool IsVillagerZombie(void) const {return m_bIsVillagerZombie; } bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
bool IsConverting(void) const {return m_bIsConverting; } bool IsConverting (void) const {return m_IsConverting; }
private: private:
bool m_bIsVillagerZombie, m_bIsConverting; bool m_IsVillagerZombie;
bool m_IsConverting;
} ; } ;