Villager: Farmers can't place crops on blocks other then farmland.
This commit is contained in:
parent
9cf006ecea
commit
5b983b72fa
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user