1
0

Renamed variables in cWolf.

This commit is contained in:
STRWarrior 2013-11-10 21:24:36 +01:00
parent e62858ec3d
commit 2ccf9b2b32
2 changed files with 29 additions and 29 deletions

View File

@ -12,12 +12,12 @@
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_bIsAngry(false), m_IsAngry(false),
m_bIsTame(false), m_IsTame(false),
m_bIsSitting(false), m_IsSitting(false),
m_bIsBegging(false), m_IsBegging(false),
m_bOwner(""), m_Owner(""),
m_bCollar(14) m_Collar(14)
{ {
} }
@ -28,9 +28,9 @@ cWolf::cWolf(void) :
void cWolf::DoTakeDamage(TakeDamageInfo & a_TDI) void cWolf::DoTakeDamage(TakeDamageInfo & a_TDI)
{ {
super::DoTakeDamage(a_TDI); super::DoTakeDamage(a_TDI);
if (!m_bIsTame) if (!m_IsTame)
{ {
m_bIsAngry = true; m_IsAngry = true;
} }
m_World->BroadcastEntityMetadata(*this); // Broadcast health and possibly angry face m_World->BroadcastEntityMetadata(*this); // Broadcast health and possibly angry face
} }
@ -65,11 +65,11 @@ void cWolf::OnRightClicked(cPlayer & a_Player)
} }
else if (IsTame()) else if (IsTame())
{ {
if (a_Player.GetName() == m_bOwner) // Is the player the owner of the dog? if (a_Player.GetName() == m_Owner) // Is the player the owner of the dog?
{ {
if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE)
{ {
m_bCollar = 15 - a_Player.GetEquippedItem().m_ItemDamage; m_Collar = 15 - a_Player.GetEquippedItem().m_ItemDamage;
if (!a_Player.IsGameModeCreative()) if (!a_Player.IsGameModeCreative())
{ {
a_Player.GetInventory().RemoveOneEquippedItem(); a_Player.GetInventory().RemoveOneEquippedItem();
@ -153,12 +153,12 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk)
Vector3f OwnerCoords; Vector3f OwnerCoords;
} ; } ;
cCallback Callback; cCallback Callback;
m_World->DoWithPlayer(m_bOwner, Callback); m_World->DoWithPlayer(m_Owner, Callback);
Vector3f OwnerCoords = Callback.OwnerCoords; Vector3f OwnerCoords = Callback.OwnerCoords;
if (IsTame()) if (IsTame())
{ {
if (m_bOwner != "") if (m_Owner != "")
{ {
double Distance = (OwnerCoords - GetPosition()).Length(); double Distance = (OwnerCoords - GetPosition()).Length();
if (Distance < 3) if (Distance < 3)

View File

@ -23,28 +23,28 @@ public:
virtual void Tick(float a_Dt, cChunk & a_Chunk) override; virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
// Get functions // Get functions
bool IsSitting(void) const { return m_bIsSitting; } bool IsSitting(void) const { return m_IsSitting; }
bool IsTame(void) const { return m_bIsTame; } bool IsTame(void) const { return m_IsTame; }
bool IsBegging(void) const { return m_bIsBegging; } bool IsBegging(void) const { return m_IsBegging; }
bool IsAngry(void) const { return m_bIsAngry; } bool IsAngry(void) const { return m_IsAngry; }
AString GetOwner(void) const { return m_bOwner; } AString GetOwner(void) const { return m_Owner; }
int GetCollarColor(void) const { return m_bCollar; } int GetCollarColor(void) const { return m_Collar; }
// Set functions // Set functions
void SetIsSitting(bool a_IsSitting) { m_bIsSitting = a_IsSitting; } void SetIsSitting(bool a_IsSitting) { m_IsSitting = a_IsSitting; }
void SetIsTame(bool a_IsTame) { m_bIsTame = a_IsTame; } void SetIsTame(bool a_IsTame) { m_IsTame = a_IsTame; }
void SetIsBegging(bool a_IsBegging) { m_bIsBegging = a_IsBegging; } void SetIsBegging(bool a_IsBegging) { m_IsBegging = a_IsBegging; }
void SetIsAngry(bool a_IsAngry) { m_bIsAngry = a_IsAngry; } void SetIsAngry(bool a_IsAngry) { m_IsAngry = a_IsAngry; }
void SetOwner(AString a_NewOwner) { m_bOwner = a_NewOwner; } void SetOwner(AString a_NewOwner) { m_Owner = a_NewOwner; }
private: private:
bool m_bIsSitting; bool m_IsSitting;
bool m_bIsTame; bool m_IsTame;
bool m_bIsBegging; bool m_IsBegging;
bool m_bIsAngry; bool m_IsAngry;
AString m_bOwner; AString m_Owner;
int m_bCollar; int m_Collar;
} ; } ;