From 421786121b0d227ba0faf0e62c52fc5952d89326 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Thu, 27 Dec 2018 01:22:46 -0600 Subject: [PATCH] Make: parcel positions more accurate --- factions.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/factions.lua b/factions.lua index 397e491..d32655b 100644 --- a/factions.lua +++ b/factions.lua @@ -942,11 +942,12 @@ function factions.Faction.on_revoke_invite(self, player) minetest.chat_send_player(player, "You are no longer invited to faction "..self.name) end +local parcel_size = factions_config.parcel_size function factions.get_parcel_pos(pos) if factions_config.protection_style == "2d" then - return math.floor(pos.x / factions_config.parcel_size)..","..math.floor(pos.z / factions_config.parcel_size) + return math.floor(pos.x / parcel_size) * parcel_size .. "," .. math.floor(pos.z / parcel_size) * parcel_size elseif factions_config.protection_style == "3d" then - return math.floor(pos.x / factions_config.parcel_size)..","..math.floor(pos.y / factions_config.parcel_size)..","..math.floor(pos.z / factions_config.parcel_size) + return math.floor(pos.x / parcel_size) * parcel_size .. "," .. math.floor(pos.y / parcel_size) * parcel_size .. "," .. math.floor(pos.z / parcel_size) * parcel_size end end