summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-04-24 19:29:12 +0200
committerGitHub <noreply@github.com>2020-04-24 19:29:12 +0200
commitc0e7708aa7966b42acdaaf1a63cc5662ca848f93 (patch)
tree23226e37312706296b2ad40e91ab900fa3cbfc3f /src/Blocks
parentPrevent bookshelf pickup crash (diff)
downloadcuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar.gz
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar.bz2
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar.lz
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar.xz
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.tar.zst
cuberite-c0e7708aa7966b42acdaaf1a63cc5662ca848f93.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockFarmland.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h
index e5a55fcdd..82c4db923 100644
--- a/src/Blocks/BlockFarmland.h
+++ b/src/Blocks/BlockFarmland.h
@@ -120,7 +120,8 @@ public:
/** Returns true if there's either a water source block close enough to hydrate the specified position, or it's raining there. */
bool IsWaterInNear(cChunk & a_Chunk, const Vector3i a_RelPos)
{
- if (a_Chunk.GetWorld()->IsWeatherWetAtXYZ(a_RelPos))
+ const auto WorldPos = a_Chunk.RelativeToAbsolute(a_RelPos);
+ if (a_Chunk.GetWorld()->IsWeatherWetAtXYZ(WorldPos))
{
// Rain hydrates farmland, too
return true;
@@ -130,7 +131,6 @@ public:
// Ref.: https://minecraft.gamepedia.com/Farmland#Hydration
// TODO: Rewrite this to use the chunk and its neighbors directly
cBlockArea Area;
- auto WorldPos = a_Chunk.RelativeToAbsolute(a_RelPos);
if (!Area.Read(*a_Chunk.GetWorld(), WorldPos - Vector3i(4, 0, 4), WorldPos + Vector3i(4, 1, 4)))
{
// Too close to the world edge, cannot check surroundings