1
0
Fork 0

Villager: Farmers can't place crops on blocks other then farmland.

This commit is contained in:
STRWarrior 2014-01-27 20:44:18 +01:00
parent 9cf006ecea
commit 5b983b72fa
1 changed files with 7 additions and 1 deletions

View File

@ -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;