summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhonkhortisan <khonkhortisan@gmail.com>2013-04-07 14:20:32 -0700
committerkhonkhortisan <khonkhortisan@gmail.com>2013-04-07 14:27:31 -0700
commitf1a327ad16d784295fe41d3f2d363471c7ddbc9c (patch)
tree9cd031f0657536c442d7716a34a1a7e1b4c7f227
parente45a2a511e4e371642cf60a8d0cb5df0123eead1 (diff)
downloadmesecons-f1a327ad16d784295fe41d3f2d363471c7ddbc9c.tar
mesecons-f1a327ad16d784295fe41d3f2d363471c7ddbc9c.tar.gz
mesecons-f1a327ad16d784295fe41d3f2d363471c7ddbc9c.tar.bz2
mesecons-f1a327ad16d784295fe41d3f2d363471c7ddbc9c.tar.xz
mesecons-f1a327ad16d784295fe41d3f2d363471c7ddbc9c.zip
Round movestone position, don't forget last pull
-rw-r--r--mesecons_movestones/init.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index ede5211..1255c67 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -88,7 +88,7 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
on_step = function(self, dtime)
local pos = self.object:getpos()
- pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
+ pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
local direction = mesecon:get_movestone_direction(pos)
if not direction then -- no mesecon power
@@ -172,7 +172,7 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
on_step = function(self, dtime)
local pos = self.object:getpos()
- pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
+ pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
local direction = mesecon:get_movestone_direction(pos)
if not direction then -- no mesecon power
@@ -180,6 +180,8 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
if name ~= "air" and name ~= "ignore"
and minetest.registered_nodes[name].liquidtype == "none" then
mesecon:mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
+ --STICKY
+ mesecon:mvps_pull_all(pos, self.lastdir)
end
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
self.object:remove()