summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Villager.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-07-31 19:26:33 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-07-31 19:26:33 +0200
commitd19cde93fa3344f318fb0d4ffbf5bb0397a51a75 (patch)
treeb5ee221d8a8e63c7d3b7868da1db19bf717a6ffd /src/Mobs/Villager.cpp
parentMerge pull request #2400 from cuberite/OffloadBadChunks (diff)
parentUnified the doxy-comment format. (diff)
downloadcuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.gz
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.bz2
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.lz
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.xz
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.zst
cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.zip
Diffstat (limited to 'src/Mobs/Villager.cpp')
-rw-r--r--src/Mobs/Villager.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp
index 7a1a6e448..2dc753f52 100644
--- a/src/Mobs/Villager.cpp
+++ b/src/Mobs/Villager.cpp
@@ -103,7 +103,8 @@ void cVillager::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
////////////////////////////////////////////////////////////////////////////////
-// Farmer functions.
+// Farmer functions:
+
void cVillager::HandleFarmerPrepareFarmCrops()
{
if (!m_World->VillagersShouldHarvestCrops())
@@ -112,15 +113,16 @@ void cVillager::HandleFarmerPrepareFarmCrops()
}
cBlockArea Surrounding;
- /// Read a 11x7x11 area.
+
+ // Read a 11x7x11 area:
Surrounding.Read(
m_World,
- static_cast<int>(GetPosX()) - 5,
- static_cast<int>(GetPosX()) + 6,
- static_cast<int>(GetPosY()) - 3,
- static_cast<int>(GetPosY()) + 4,
- static_cast<int>(GetPosZ()) - 5,
- static_cast<int>(GetPosZ()) + 6
+ FloorC(GetPosX()) - 5,
+ FloorC(GetPosX()) + 6,
+ FloorC(GetPosY()) - 3,
+ FloorC(GetPosY()) + 4,
+ FloorC(GetPosZ()) - 5,
+ FloorC(GetPosZ()) + 6
);
for (int I = 0; I < 5; I++)