diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-01-27 20:44:18 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-01-27 20:44:18 +0100 |
commit | 5b983b72fa0508fee5135153c9273f5e37fb5467 (patch) | |
tree | 8767c49152f344d8a263715435bc5e8bed07299c /src/Mobs/Villager.cpp | |
parent | Fixed compiler error. (diff) | |
download | cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar.gz cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar.bz2 cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar.lz cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar.xz cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.tar.zst cuberite-5b983b72fa0508fee5135153c9273f5e37fb5467.zip |
Diffstat (limited to 'src/Mobs/Villager.cpp')
-rw-r--r-- | src/Mobs/Villager.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp index ef362b559..5d6d7482f 100644 --- a/src/Mobs/Villager.cpp +++ b/src/Mobs/Villager.cpp @@ -48,7 +48,13 @@ void cVillager::Tick(float a_Dt, cChunk & a_Chunk) { switch (m_Type) { - case vtFarmer: m_World->SetBlock(m_CropsPos.x, m_CropsPos.y, m_CropsPos.z, E_BLOCK_CROPS, 0); + case vtFarmer: + { + if (m_World->GetBlock(m_CropsPos.x, m_CropsPos.y - 1, m_CropsPos.z) == E_BLOCK_FARMLAND) + { + m_World->SetBlock(m_CropsPos.x, m_CropsPos.y, m_CropsPos.z, E_BLOCK_CROPS, 0); + } + } } } return; |