summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-12-20 16:39:20 +0100
committermadmaxoft <github@xoft.cz>2013-12-20 16:39:20 +0100
commitd6de11da07af96c9989d9a80a4ee69dad7e9380e (patch)
tree9d4ed13590197d94ffd819c92771260802413e49 /src/Mobs
parentFixed minor warnings. (diff)
downloadcuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar.gz
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar.bz2
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar.lz
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar.xz
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.tar.zst
cuberite-d6de11da07af96c9989d9a80a4ee69dad7e9380e.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.cpp14
-rw-r--r--src/Mobs/Monster.h2
-rw-r--r--src/Mobs/Wolf.cpp4
-rw-r--r--src/Mobs/Zombie.cpp9
-rw-r--r--src/Mobs/Zombie.h9
5 files changed, 21 insertions, 17 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp
index 606e93408..e5d21b2f2 100644
--- a/src/Mobs/Monster.cpp
+++ b/src/Mobs/Monster.cpp
@@ -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)
: super(etMonster, a_Width, a_Height)
+ , m_EMState(IDLE)
+ , m_EMPersonality(AGGRESSIVE)
+ , m_SightDistance(25)
, m_Target(NULL)
, m_AttackRate(3)
- , idle_interval(0)
+ , m_IdleInterval(0)
, m_bMovingToDestination(false)
, m_DestinationTime( 0 )
, m_DestroyTimer( 0 )
@@ -78,10 +81,7 @@ cMonster::cMonster(const AString & a_ConfigName, eType a_MobType, const AString
, m_MobType(a_MobType)
, m_SoundHurt(a_SoundHurt)
, m_SoundDeath(a_SoundDeath)
- , m_EMState(IDLE)
- , m_SightDistance(25)
, m_SeePlayerInterval (0)
- , m_EMPersonality(AGGRESSIVE)
, m_AttackDamage(1.0f)
, m_AttackRange(2.0f)
, m_AttackInterval(0)
@@ -435,13 +435,13 @@ void cMonster::EventLosePlayer(void)
// What to do if in Idle State
void cMonster::InStateIdle(float a_Dt)
{
- idle_interval += a_Dt;
- if (idle_interval > 1)
+ m_IdleInterval += a_Dt;
+ if (m_IdleInterval > 1)
{
// at this interval the results are predictable
int rem = m_World->GetTickRandomNumber(6) + 1;
// 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;
Dist.x = (float)(m_World->GetTickRandomNumber(10) - 5);
Dist.z = (float)(m_World->GetTickRandomNumber(10) - 5);
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index 29a705d11..dafb33574 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -161,7 +161,7 @@ protected:
cEntity * m_Target;
float m_AttackRate;
- float idle_interval;
+ float m_IdleInterval;
Vector3f m_Destination;
bool m_bMovingToDestination;
diff --git a/src/Mobs/Wolf.cpp b/src/Mobs/Wolf.cpp
index c86250142..3d4e97c80 100644
--- a/src/Mobs/Wolf.cpp
+++ b/src/Mobs/Wolf.cpp
@@ -11,10 +11,10 @@
cWolf::cWolf(void) :
super("Wolf", mtWolf, "mob.wolf.hurt", "mob.wolf.death", 0.6, 0.8),
- m_IsAngry(false),
- m_IsTame(false),
m_IsSitting(false),
+ m_IsTame(false),
m_IsBegging(false),
+ m_IsAngry(false),
m_OwnerName(""),
m_CollarColor(14)
{
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index a485d2b55..29563a755 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -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),
- m_bIsConverting(false),
- m_bIsVillagerZombie(IsVillagerZombie)
+ m_IsConverting(false),
+ m_IsVillagerZombie(a_IsVillagerZombie)
{
SetBurnsInDaylight(true);
}
@@ -45,3 +46,5 @@ void cZombie::MoveToPosition(const Vector3f & a_Position)
}
+
+
diff --git a/src/Mobs/Zombie.h b/src/Mobs/Zombie.h
index 7e14fe42f..1ba368f9c 100644
--- a/src/Mobs/Zombie.h
+++ b/src/Mobs/Zombie.h
@@ -12,19 +12,20 @@ class cZombie :
typedef cAggressiveMonster super;
public:
- cZombie(bool IsVillagerZombie);
+ cZombie(bool a_IsVillagerZombie);
CLASS_PROTODEF(cZombie);
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
virtual void MoveToPosition(const Vector3f & a_Position) override;
- bool IsVillagerZombie(void) const {return m_bIsVillagerZombie; }
- bool IsConverting(void) const {return m_bIsConverting; }
+ bool IsVillagerZombie(void) const {return m_IsVillagerZombie; }
+ bool IsConverting (void) const {return m_IsConverting; }
private:
- bool m_bIsVillagerZombie, m_bIsConverting;
+ bool m_IsVillagerZombie;
+ bool m_IsConverting;
} ;