summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Villager.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-01-28 16:26:44 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-01-28 16:26:44 +0100
commit8ca98e0c0e09706561ed54cf8be95a731157a59e (patch)
tree5194bbdaab9cab2b4dff427640aa3254a298292b /src/Mobs/Villager.cpp
parentVillager: NoCountDown and Action function don't check VillagersShouldHarvestCrops anymore because it shoudn't even be activated anywhere. (diff)
downloadcuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar.gz
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar.bz2
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar.lz
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar.xz
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.tar.zst
cuberite-8ca98e0c0e09706561ed54cf8be95a731157a59e.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Villager.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp
index 021d4c672..44ec14295 100644
--- a/src/Mobs/Villager.cpp
+++ b/src/Mobs/Villager.cpp
@@ -41,6 +41,7 @@ void cVillager::DoTakeDamage(TakeDamageInfo & a_TDI)
void cVillager::Tick(float a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);
+
if (m_ActionCountDown > -1)
{
m_ActionCountDown--;
@@ -50,7 +51,7 @@ void cVillager::Tick(float a_Dt, cChunk & a_Chunk)
{
case vtFarmer:
{
- HandleFarmerEndCountDown();
+ HandleFarmerPlaceCrops();
}
}
}
@@ -63,15 +64,10 @@ void cVillager::Tick(float a_Dt, cChunk & a_Chunk)
{
case vtFarmer:
{
- HandleFarmerAction();
+ HandleFarmerTryHarvestCrops();
}
}
m_VillagerAction = false;
- }
-
- // The villager already has an special action activated.
- if (m_VillagerAction)
- {
return;
}
@@ -85,7 +81,7 @@ void cVillager::Tick(float a_Dt, cChunk & a_Chunk)
{
case vtFarmer:
{
- HandleFarmerAttemptSpecialAction();
+ HandleFarmerPrepareFarmCrops();
}
}
}
@@ -95,7 +91,7 @@ void cVillager::Tick(float a_Dt, cChunk & a_Chunk)
////////////////////////////////////////////////////////////////////////////////
// Farmer functions.
-void cVillager::HandleFarmerAttemptSpecialAction()
+void cVillager::HandleFarmerPrepareFarmCrops()
{
if (!m_World->VillagersShouldHarvestCrops())
{
@@ -144,7 +140,7 @@ void cVillager::HandleFarmerAttemptSpecialAction()
-void cVillager::HandleFarmerAction()
+void cVillager::HandleFarmerTryHarvestCrops()
{
// Harvest the crops if the villager isn't moving and if the crops are closer then 2 blocks.
if (!m_bMovingToDestination && (GetPosition() - m_CropsPos).Length() < 2)
@@ -164,7 +160,7 @@ void cVillager::HandleFarmerAction()
-void cVillager::HandleFarmerEndCountDown()
+void cVillager::HandleFarmerPlaceCrops()
{
// Check if there is still farmland at the spot where the crops were.
if (m_World->GetBlock(m_CropsPos.x, m_CropsPos.y - 1, m_CropsPos.z) == E_BLOCK_FARMLAND)