From 38f6fff3fbe7c90899b319f53b08d48714a3c845 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 15:16:43 +0100 Subject: Wolves can now be owned by an entity. They only sit when right clicked by their owner. They beg if the closest player has meat or bones in his hand. They follow their owner. They teleport to their owner if they are more then 30 blocks away. They don't attack players if they are not angry anymore. They don't move if they are sitting. --- source/Mobs/Wolf.cpp | 94 ++++++++++++++++++++++++++++++++++++++++++++++------ source/Mobs/Wolf.h | 23 +++++++++---- 2 files changed, 100 insertions(+), 17 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index 2baeb4b7b..e9d3ce394 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -14,7 +14,8 @@ cWolf::cWolf(void) : m_bIsAngry(false), m_bIsTame(false), m_bIsSitting(false), - m_bIsBegging(false) + m_bIsBegging(false), + m_bOwner(NULL) { } @@ -38,7 +39,7 @@ void cWolf::DoTakeDamage(TakeDamageInfo & a_TDI) void cWolf::OnRightClicked(cPlayer & a_Player) { - if ((!m_bIsTame) && (!m_bIsAngry)) + if ((!IsTame()) && (!IsAngry())) { if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_BONE) { @@ -47,10 +48,11 @@ void cWolf::OnRightClicked(cPlayer & a_Player) a_Player.GetInventory().RemoveOneEquippedItem(); } - if (m_World->GetTickRandomNumber(10) == 5) + if (m_World->GetTickRandomNumber(7) == 0) { SetMaxHealth(20); - m_bIsTame = true; + SetIsTame(true); + SetOwner(&a_Player); m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_WOLF_TAMED); } else @@ -59,15 +61,18 @@ void cWolf::OnRightClicked(cPlayer & a_Player) } } } - else if (m_bIsTame) + else if (IsTame()) { - if (m_bIsSitting) + if (m_bOwner != NULL && a_Player.GetUniqueID() == m_bOwner->GetUniqueID()) // Is the player the owner of the dog? { - m_bIsSitting = false; - } - else - { - m_bIsSitting = true; + if (IsSitting()) + { + SetIsSitting(false); + } + else + { + SetIsSitting(true); + } } } @@ -77,3 +82,70 @@ void cWolf::OnRightClicked(cPlayer & a_Player) + +void cWolf::Tick(float a_Dt, cChunk & a_Chunk) +{ + if (!IsAngry()) + { + super::cMonster::Tick(a_Dt, a_Chunk); + } else { + super::Tick(a_Dt, a_Chunk); + } + + if (IsSitting()) + { + m_bMovingToDestination = false; + } + + cPlayer * a_Closest_Player = FindClosestPlayer(); + if (a_Closest_Player != NULL) + { + switch (a_Closest_Player->GetEquippedItem().m_ItemType) + { + case E_ITEM_BONE: + case E_ITEM_RAW_BEEF: + case E_ITEM_STEAK: + case E_ITEM_RAW_CHICKEN: + case E_ITEM_COOKED_CHICKEN: + case E_ITEM_ROTTEN_FLESH: + { + if (!IsBegging()) + { + SetIsBegging(true); + m_World->BroadcastEntityMetadata(*this); + } + Vector3f a_NewDestination = a_Closest_Player->GetPosition(); + a_NewDestination.y = a_NewDestination.y + 1; // Look at the head of the player, not his feet. + m_Destination = Vector3f(a_NewDestination); + m_bMovingToDestination = false; + break; + } + default: + { + if (IsBegging()) + { + SetIsBegging(false); + m_World->BroadcastEntityMetadata(*this); + } + } + } + } + + if (IsTame()) + { + if (m_bOwner != NULL) + { + Vector3f OwnerCoords = m_bOwner->GetPosition(); + double Distance = (OwnerCoords - GetPosition()).Length(); + if (Distance < 3) + { + m_bMovingToDestination = false; + } else if((Distance > 30) && (!IsSitting())) { + TeleportToEntity(*m_bOwner); + } else { + m_Destination = OwnerCoords; + } + } + } + +} \ No newline at end of file diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index 98074ba11..e1ce25200 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -2,6 +2,7 @@ #pragma once #include "PassiveAggressiveMonster.h" +#include "../Entities/Entity.h" @@ -19,11 +20,21 @@ public: virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override; virtual void OnRightClicked(cPlayer & a_Player) override; - - bool IsSitting(void) const { return m_bIsSitting; } - bool IsTame(void) const { return m_bIsTame; } - bool IsBegging(void) const { return m_bIsBegging; } - bool IsAngry(void) const { return m_bIsAngry; } + virtual void Tick(float a_Dt, cChunk & a_Chunk) override; + + // Get functions + bool IsSitting(void) const { return m_bIsSitting; } + bool IsTame(void) const { return m_bIsTame; } + bool IsBegging(void) const { return m_bIsBegging; } + bool IsAngry(void) const { return m_bIsAngry; } + cEntity * GetOwner(void) const { return m_bOwner; } + + // Set functions + void SetIsSitting(bool a_IsSitting) { m_bIsSitting = a_IsSitting; } + void SetIsTame(bool a_IsTame) { m_bIsTame = a_IsTame; } + void SetIsBegging(bool a_IsBegging) { m_bIsBegging = a_IsBegging; } + void SetIsAngry(bool a_IsAngry) { m_bIsAngry = a_IsAngry; } + void SetOwner(cEntity * a_Entity) { m_bOwner = a_Entity; } private: @@ -31,7 +42,7 @@ private: bool m_bIsTame; bool m_bIsBegging; bool m_bIsAngry; - + cEntity * m_bOwner; } ; -- cgit v1.2.3 From 09805679120dc5aa5f236664245c475a4a34d197 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 15:51:32 +0100 Subject: Using cMonster::Tick instead of super::cMonster::Tick --- source/Mobs/Wolf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index e9d3ce394..ad8360445 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -87,7 +87,7 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) { if (!IsAngry()) { - super::cMonster::Tick(a_Dt, a_Chunk); + cMonster::Tick(a_Dt, a_Chunk); } else { super::Tick(a_Dt, a_Chunk); } -- cgit v1.2.3 From e919496025bdb2dfc47e4686d767ffaa88b007af Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Sun, 10 Nov 2013 16:03:00 +0100 Subject: Added sheep dyeing --- source/Mobs/Sheep.cpp | 158 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 2 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index 703482ddb..85081b294 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -33,7 +33,6 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer) - void cSheep::OnRightClicked(cPlayer & a_Player) { if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SHEARS) && (!m_IsSheared)) @@ -51,9 +50,164 @@ void cSheep::OnRightClicked(cPlayer & a_Player) Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } -} + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLACK) + { + m_WoolColor = 15; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_RED) + { + m_WoolColor = 14; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GREEN) + { + m_WoolColor = 13; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BROWN) + { + m_WoolColor = 12; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLUE) + { + m_WoolColor = 11; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PURPLE) + { + m_WoolColor = 10; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_CYAN) + { + m_WoolColor = 9; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGRAY) + { + m_WoolColor = 8; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GRAY) + { + m_WoolColor = 7; + m_World->BroadcastEntityMetadata(*this); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PINK) + { + m_WoolColor = 6; + m_World->BroadcastEntityMetadata(*this); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGREEN) + { + m_WoolColor = 5; + m_World->BroadcastEntityMetadata(*this); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_YELLOW) + { + m_WoolColor = 4; + m_World->BroadcastEntityMetadata(*this); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTBLUE) + { + m_WoolColor = 3; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_MAGENTA) + { + m_WoolColor = 2; + m_World->BroadcastEntityMetadata(*this); + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_ORANGE) + { + m_WoolColor = 1; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_WHITE) + { + m_WoolColor = 0; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } +} -- cgit v1.2.3 From 9da4011a7fc0f98efb2f1a9d8ad5af6e7bb0a5a9 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Sun, 10 Nov 2013 16:42:38 +0100 Subject: You can no longer color with wood --- source/Mobs/Sheep.cpp | 319 +++++++++++++++++++++++++------------------------- 1 file changed, 161 insertions(+), 158 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index 85081b294..f9fc5a60c 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -50,164 +50,167 @@ void cSheep::OnRightClicked(cPlayer & a_Player) Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLACK) - { - m_WoolColor = 15; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_RED) - { - m_WoolColor = 14; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GREEN) - { - m_WoolColor = 13; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BROWN) - { - m_WoolColor = 12; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLUE) - { - m_WoolColor = 11; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PURPLE) - { - m_WoolColor = 10; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_CYAN) - { - m_WoolColor = 9; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGRAY) - { - m_WoolColor = 8; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GRAY) - { - m_WoolColor = 7; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PINK) - { - m_WoolColor = 6; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGREEN) - { - m_WoolColor = 5; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_YELLOW) - { - m_WoolColor = 4; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTBLUE) - { - m_WoolColor = 3; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_MAGENTA) - { - m_WoolColor = 2; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_ORANGE) - { - m_WoolColor = 1; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_WHITE) - { - m_WoolColor = 0; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); + if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE + ) + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLACK) + { + m_WoolColor = 15; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_RED) + { + m_WoolColor = 14; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GREEN) + { + m_WoolColor = 13; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BROWN) + { + m_WoolColor = 12; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLUE) + { + m_WoolColor = 11; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PURPLE) + { + m_WoolColor = 10; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_CYAN) + { + m_WoolColor = 9; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGRAY) + { + m_WoolColor = 8; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GRAY) + { + m_WoolColor = 7; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PINK) + { + m_WoolColor = 6; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGREEN) + { + m_WoolColor = 5; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_YELLOW) + { + m_WoolColor = 4; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTBLUE) + { + m_WoolColor = 3; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_MAGENTA) + { + m_WoolColor = 2; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_ORANGE) + { + m_WoolColor = 1; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_WHITE) + { + m_WoolColor = 0; + m_World->BroadcastEntityMetadata(*this); + + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } } } } -- cgit v1.2.3 From e2b4745bbf657272f13a5d70b129a7f523c46918 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Sun, 10 Nov 2013 16:43:47 +0100 Subject: Fixed compilation --- source/Mobs/Sheep.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index f9fc5a60c..de5874132 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Sheep.h" @@ -50,8 +49,8 @@ void cSheep::OnRightClicked(cPlayer & a_Player) Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } - if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE - ) + if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) + { if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLACK) { m_WoolColor = 15; -- cgit v1.2.3 From da5bd81836f12588a5fcba62e1f4bc27420b5222 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Sun, 10 Nov 2013 16:48:22 +0100 Subject: STR_Warrior was right. Simplified code. --- source/Mobs/Sheep.cpp | 161 +------------------------------------------------- 1 file changed, 1 insertion(+), 160 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index de5874132..e8d0be2ae 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -51,165 +51,6 @@ void cSheep::OnRightClicked(cPlayer & a_Player) } if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) { - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLACK) - { - m_WoolColor = 15; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_RED) - { - m_WoolColor = 14; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GREEN) - { - m_WoolColor = 13; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BROWN) - { - m_WoolColor = 12; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_BLUE) - { - m_WoolColor = 11; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PURPLE) - { - m_WoolColor = 10; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_CYAN) - { - m_WoolColor = 9; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGRAY) - { - m_WoolColor = 8; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_GRAY) - { - m_WoolColor = 7; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_PINK) - { - m_WoolColor = 6; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTGREEN) - { - m_WoolColor = 5; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_YELLOW) - { - m_WoolColor = 4; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_LIGHTBLUE) - { - m_WoolColor = 3; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_MAGENTA) - { - m_WoolColor = 2; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_ORANGE) - { - m_WoolColor = 1; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } - if (a_Player.GetEquippedItem().m_ItemDamage == E_META_DYE_WHITE) - { - m_WoolColor = 0; - m_World->BroadcastEntityMetadata(*this); - - if (!a_Player.IsGameModeCreative()) - { - a_Player.GetInventory().RemoveOneEquippedItem(); - } - } + m_WoolColor = 15 - a_Player.GetEquippedItem().m_ItemDamage; } } -- cgit v1.2.3 From 4af5868322757b892d976d9549633f40f0e7eeb4 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Sun, 10 Nov 2013 17:05:19 +0100 Subject: Fixes (SEE DESC) Entity metadata is broadcasted. If player is in survival, his equipped item is removed. If you have green dye, and sheep is green, your equipped item won't be removed. --- source/Mobs/Sheep.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index e8d0be2ae..bda4ccff8 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -1,3 +1,4 @@ + #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Sheep.h" @@ -49,8 +50,13 @@ void cSheep::OnRightClicked(cPlayer & a_Player) Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } - if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) + if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - a_Player.GetEquippedItem().m_ItemDamage)) { m_WoolColor = 15 - a_Player.GetEquippedItem().m_ItemDamage; + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + m_World->BroadcastEntityMetadata(*this); } } -- cgit v1.2.3 From 4f11cd2f8a665dcda7f06c1b5e1c8b8cda7b38ad Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 18:03:19 +0100 Subject: The owner object isn't stored anymore. Instead we use the name of the player. This means only players can now have a wolf, but it fixes the bug where when you log out the wolf isn't your wolf anymore. --- source/Mobs/Wolf.cpp | 28 +++++++++++++++++++++------- source/Mobs/Wolf.h | 6 +++--- 2 files changed, 24 insertions(+), 10 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index ad8360445..6d1c5565c 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -4,6 +4,7 @@ #include "Wolf.h" #include "../World.h" #include "../Entities/Player.h" +#include "../Root.h" @@ -15,7 +16,7 @@ cWolf::cWolf(void) : m_bIsTame(false), m_bIsSitting(false), m_bIsBegging(false), - m_bOwner(NULL) + m_bOwner("") { } @@ -52,7 +53,7 @@ void cWolf::OnRightClicked(cPlayer & a_Player) { SetMaxHealth(20); SetIsTame(true); - SetOwner(&a_Player); + SetOwner(a_Player.GetName()); m_World->BroadcastEntityStatus(*this, ENTITY_STATUS_WOLF_TAMED); } else @@ -63,7 +64,7 @@ void cWolf::OnRightClicked(cPlayer & a_Player) } else if (IsTame()) { - if (m_bOwner != NULL && a_Player.GetUniqueID() == m_bOwner->GetUniqueID()) // Is the player the owner of the dog? + if (a_Player.GetName() == m_bOwner) // Is the player the owner of the dog? { if (IsSitting()) { @@ -130,22 +131,35 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) } } } + + class cCallback : + public cPlayerListCallback + { + virtual bool Item(cPlayer * Player) override + { + OwnerCoords = Player->GetPosition(); + return false; + } + public: + Vector3f OwnerCoords; + } ; + cCallback Callback; + m_World->FindAndDoWithPlayer(m_bOwner, Callback); + Vector3f OwnerCoords = Callback.OwnerCoords; if (IsTame()) { - if (m_bOwner != NULL) + if (m_bOwner != "") { - Vector3f OwnerCoords = m_bOwner->GetPosition(); double Distance = (OwnerCoords - GetPosition()).Length(); if (Distance < 3) { m_bMovingToDestination = false; } else if((Distance > 30) && (!IsSitting())) { - TeleportToEntity(*m_bOwner); + TeleportToCoords(OwnerCoords.x, OwnerCoords.y, OwnerCoords.z); } else { m_Destination = OwnerCoords; } } } - } \ No newline at end of file diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index e1ce25200..fb6bb2355 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -27,14 +27,14 @@ public: bool IsTame(void) const { return m_bIsTame; } bool IsBegging(void) const { return m_bIsBegging; } bool IsAngry(void) const { return m_bIsAngry; } - cEntity * GetOwner(void) const { return m_bOwner; } + AString GetOwner(void) const { return m_bOwner; } // Set functions void SetIsSitting(bool a_IsSitting) { m_bIsSitting = a_IsSitting; } void SetIsTame(bool a_IsTame) { m_bIsTame = a_IsTame; } void SetIsBegging(bool a_IsBegging) { m_bIsBegging = a_IsBegging; } void SetIsAngry(bool a_IsAngry) { m_bIsAngry = a_IsAngry; } - void SetOwner(cEntity * a_Entity) { m_bOwner = a_Entity; } + void SetOwner(AString a_NewOwner) { m_bOwner = a_NewOwner; } private: @@ -42,7 +42,7 @@ private: bool m_bIsTame; bool m_bIsBegging; bool m_bIsAngry; - cEntity * m_bOwner; + AString m_bOwner; } ; -- cgit v1.2.3 From e62858ec3d027de8c5c4605913ab6261ec19d624 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 20:12:30 +0100 Subject: Using DoWithPlayer instead of FindAndDoWithPlayer for callbacks. You are able to dye the collar. --- source/Mobs/Wolf.cpp | 15 ++++++++++++--- source/Mobs/Wolf.h | 10 ++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index 6d1c5565c..9880a3442 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -16,7 +16,8 @@ cWolf::cWolf(void) : m_bIsTame(false), m_bIsSitting(false), m_bIsBegging(false), - m_bOwner("") + m_bOwner(""), + m_bCollar(14) { } @@ -66,7 +67,15 @@ void cWolf::OnRightClicked(cPlayer & a_Player) { if (a_Player.GetName() == m_bOwner) // Is the player the owner of the dog? { - if (IsSitting()) + if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) + { + m_bCollar = 15 - a_Player.GetEquippedItem().m_ItemDamage; + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + } + else if (IsSitting()) { SetIsSitting(false); } @@ -144,7 +153,7 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) Vector3f OwnerCoords; } ; cCallback Callback; - m_World->FindAndDoWithPlayer(m_bOwner, Callback); + m_World->DoWithPlayer(m_bOwner, Callback); Vector3f OwnerCoords = Callback.OwnerCoords; if (IsTame()) diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index fb6bb2355..2afca8086 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -28,6 +28,7 @@ public: bool IsBegging(void) const { return m_bIsBegging; } bool IsAngry(void) const { return m_bIsAngry; } AString GetOwner(void) const { return m_bOwner; } + int GetCollarColor(void) const { return m_bCollar; } // Set functions void SetIsSitting(bool a_IsSitting) { m_bIsSitting = a_IsSitting; } @@ -38,11 +39,12 @@ public: private: - bool m_bIsSitting; - bool m_bIsTame; - bool m_bIsBegging; - bool m_bIsAngry; + bool m_bIsSitting; + bool m_bIsTame; + bool m_bIsBegging; + bool m_bIsAngry; AString m_bOwner; + int m_bCollar; } ; -- cgit v1.2.3 From 2ccf9b2b32cbc2b9df7bd89b5dd4077c7bc20b80 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 21:24:36 +0100 Subject: Renamed variables in cWolf. --- source/Mobs/Wolf.cpp | 24 ++++++++++++------------ source/Mobs/Wolf.h | 34 +++++++++++++++++----------------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index 9880a3442..ac094e870 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -12,12 +12,12 @@ cWolf::cWolf(void) : super("Wolf", mtWolf, "mob.wolf.hurt", "mob.wolf.death", 0.6, 0.8), - m_bIsAngry(false), - m_bIsTame(false), - m_bIsSitting(false), - m_bIsBegging(false), - m_bOwner(""), - m_bCollar(14) + m_IsAngry(false), + m_IsTame(false), + m_IsSitting(false), + m_IsBegging(false), + m_Owner(""), + m_Collar(14) { } @@ -28,9 +28,9 @@ cWolf::cWolf(void) : void cWolf::DoTakeDamage(TakeDamageInfo & 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 } @@ -65,11 +65,11 @@ void cWolf::OnRightClicked(cPlayer & a_Player) } 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) { - m_bCollar = 15 - a_Player.GetEquippedItem().m_ItemDamage; + m_Collar = 15 - a_Player.GetEquippedItem().m_ItemDamage; if (!a_Player.IsGameModeCreative()) { a_Player.GetInventory().RemoveOneEquippedItem(); @@ -153,12 +153,12 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) Vector3f OwnerCoords; } ; cCallback Callback; - m_World->DoWithPlayer(m_bOwner, Callback); + m_World->DoWithPlayer(m_Owner, Callback); Vector3f OwnerCoords = Callback.OwnerCoords; if (IsTame()) { - if (m_bOwner != "") + if (m_Owner != "") { double Distance = (OwnerCoords - GetPosition()).Length(); if (Distance < 3) diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index 2afca8086..bc26fbf9b 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -23,28 +23,28 @@ public: virtual void Tick(float a_Dt, cChunk & a_Chunk) override; // Get functions - bool IsSitting(void) const { return m_bIsSitting; } - bool IsTame(void) const { return m_bIsTame; } - bool IsBegging(void) const { return m_bIsBegging; } - bool IsAngry(void) const { return m_bIsAngry; } - AString GetOwner(void) const { return m_bOwner; } - int GetCollarColor(void) const { return m_bCollar; } + bool IsSitting(void) const { return m_IsSitting; } + bool IsTame(void) const { return m_IsTame; } + bool IsBegging(void) const { return m_IsBegging; } + bool IsAngry(void) const { return m_IsAngry; } + AString GetOwner(void) const { return m_Owner; } + int GetCollarColor(void) const { return m_Collar; } // Set functions - void SetIsSitting(bool a_IsSitting) { m_bIsSitting = a_IsSitting; } - void SetIsTame(bool a_IsTame) { m_bIsTame = a_IsTame; } - void SetIsBegging(bool a_IsBegging) { m_bIsBegging = a_IsBegging; } - void SetIsAngry(bool a_IsAngry) { m_bIsAngry = a_IsAngry; } - void SetOwner(AString a_NewOwner) { m_bOwner = a_NewOwner; } + void SetIsSitting(bool a_IsSitting) { m_IsSitting = a_IsSitting; } + void SetIsTame(bool a_IsTame) { m_IsTame = a_IsTame; } + void SetIsBegging(bool a_IsBegging) { m_IsBegging = a_IsBegging; } + void SetIsAngry(bool a_IsAngry) { m_IsAngry = a_IsAngry; } + void SetOwner(AString a_NewOwner) { m_Owner = a_NewOwner; } private: - bool m_bIsSitting; - bool m_bIsTame; - bool m_bIsBegging; - bool m_bIsAngry; - AString m_bOwner; - int m_bCollar; + bool m_IsSitting; + bool m_IsTame; + bool m_IsBegging; + bool m_IsAngry; + AString m_Owner; + int m_Collar; } ; -- cgit v1.2.3 From dadae874f20259e88d20e7ccbb34c8617e69bf40 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 10 Nov 2013 21:55:32 +0100 Subject: Small code-style fixes. --- source/Mobs/Wolf.cpp | 27 ++++++++++++++++++--------- source/Mobs/Wolf.h | 27 ++++++++++++++------------- 2 files changed, 32 insertions(+), 22 deletions(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index ac094e870..02052e374 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -17,7 +17,7 @@ cWolf::cWolf(void) : m_IsSitting(false), m_IsBegging(false), m_Owner(""), - m_Collar(14) + m_CollarColor(14) { } @@ -41,7 +41,7 @@ void cWolf::DoTakeDamage(TakeDamageInfo & a_TDI) void cWolf::OnRightClicked(cPlayer & a_Player) { - if ((!IsTame()) && (!IsAngry())) + if (!IsTame() && !IsAngry()) { if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_BONE) { @@ -69,7 +69,7 @@ void cWolf::OnRightClicked(cPlayer & a_Player) { if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) { - m_Collar = 15 - a_Player.GetEquippedItem().m_ItemDamage; + m_CollarColor = 15 - a_Player.GetEquippedItem().m_ItemDamage; if (!a_Player.IsGameModeCreative()) { a_Player.GetInventory().RemoveOneEquippedItem(); @@ -98,7 +98,9 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) if (!IsAngry()) { cMonster::Tick(a_Dt, a_Chunk); - } else { + } + else + { super::Tick(a_Dt, a_Chunk); } @@ -151,8 +153,7 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) } public: Vector3f OwnerCoords; - } ; - cCallback Callback; + } Callback; m_World->DoWithPlayer(m_Owner, Callback); Vector3f OwnerCoords = Callback.OwnerCoords; @@ -164,11 +165,19 @@ void cWolf::Tick(float a_Dt, cChunk & a_Chunk) if (Distance < 3) { m_bMovingToDestination = false; - } else if((Distance > 30) && (!IsSitting())) { + } + else if ((Distance > 30) && (!IsSitting())) + { TeleportToCoords(OwnerCoords.x, OwnerCoords.y, OwnerCoords.z); - } else { + } + else + { m_Destination = OwnerCoords; } } } -} \ No newline at end of file +} + + + + diff --git a/source/Mobs/Wolf.h b/source/Mobs/Wolf.h index bc26fbf9b..d51d4e78a 100644 --- a/source/Mobs/Wolf.h +++ b/source/Mobs/Wolf.h @@ -23,28 +23,29 @@ public: virtual void Tick(float a_Dt, cChunk & a_Chunk) override; // Get functions - bool IsSitting(void) const { return m_IsSitting; } - bool IsTame(void) const { return m_IsTame; } - bool IsBegging(void) const { return m_IsBegging; } - bool IsAngry(void) const { return m_IsAngry; } - AString GetOwner(void) const { return m_Owner; } - int GetCollarColor(void) const { return m_Collar; } + bool IsSitting (void) const { return m_IsSitting; } + bool IsTame (void) const { return m_IsTame; } + bool IsBegging (void) const { return m_IsBegging; } + bool IsAngry (void) const { return m_IsAngry; } + AString GetOwner (void) const { return m_Owner; } + int GetCollarColor(void) const { return m_CollarColor; } // Set functions - void SetIsSitting(bool a_IsSitting) { m_IsSitting = a_IsSitting; } - void SetIsTame(bool a_IsTame) { m_IsTame = a_IsTame; } - void SetIsBegging(bool a_IsBegging) { m_IsBegging = a_IsBegging; } - void SetIsAngry(bool a_IsAngry) { m_IsAngry = a_IsAngry; } - void SetOwner(AString a_NewOwner) { m_Owner = a_NewOwner; } + void SetIsSitting (bool a_IsSitting) { m_IsSitting = a_IsSitting; } + void SetIsTame (bool a_IsTame) { m_IsTame = a_IsTame; } + void SetIsBegging (bool a_IsBegging) { m_IsBegging = a_IsBegging; } + void SetIsAngry (bool a_IsAngry) { m_IsAngry = a_IsAngry; } + void SetOwner (AString a_NewOwner) { m_Owner = a_NewOwner; } + void SetCollarColor(int a_CollarColor) { m_CollarColor = a_CollarColor; } -private: +protected: bool m_IsSitting; bool m_IsTame; bool m_IsBegging; bool m_IsAngry; AString m_Owner; - int m_Collar; + int m_CollarColor; } ; -- cgit v1.2.3 From 165f68b8d92975c0988cf79885f5ee5c967c8e13 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sun, 10 Nov 2013 21:56:37 +0100 Subject: Removed #include "../Root.h" since it isn't needed. --- source/Mobs/Wolf.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'source/Mobs') diff --git a/source/Mobs/Wolf.cpp b/source/Mobs/Wolf.cpp index 02052e374..b9db53c7f 100644 --- a/source/Mobs/Wolf.cpp +++ b/source/Mobs/Wolf.cpp @@ -4,7 +4,6 @@ #include "Wolf.h" #include "../World.h" #include "../Entities/Player.h" -#include "../Root.h" -- cgit v1.2.3