Skip to content

Commit c08e868

Browse files
committedApr 8, 2013
Merge pull request #92 from khonkhortisan/lazypull
Round movestone position, don't forget last pull
2 parents e45a2a5 + f1a327a commit c08e868

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎mesecons_movestones/init.lua

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ minetest.register_entity("mesecons_movestones:movestone_entity", {
8888

8989
on_step = function(self, dtime)
9090
local pos = self.object:getpos()
91-
pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
91+
pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
9292
local direction = mesecon:get_movestone_direction(pos)
9393

9494
if not direction then -- no mesecon power
@@ -172,14 +172,16 @@ minetest.register_entity("mesecons_movestones:sticky_movestone_entity", {
172172

173173
on_step = function(self, dtime)
174174
local pos = self.object:getpos()
175-
pos.x, pos.y, pos.z = math.floor(pos.x), math.floor(pos.y), math.floor(pos.z)
175+
pos.x, pos.y, pos.z = math.floor(pos.x+0.5), math.floor(pos.y+0.5), math.floor(pos.z+0.5)
176176
local direction = mesecon:get_movestone_direction(pos)
177177

178178
if not direction then -- no mesecon power
179179
local name = minetest.env:get_node(pos).name
180180
if name ~= "air" and name ~= "ignore"
181181
and minetest.registered_nodes[name].liquidtype == "none" then
182182
mesecon:mvps_push(pos, self.lastdir, MOVESTONE_MAXIMUM_PUSH)
183+
--STICKY
184+
mesecon:mvps_pull_all(pos, self.lastdir)
183185
end
184186
minetest.env:add_node(pos, {name="mesecons_movestones:sticky_movestone"})
185187
self.object:remove()

0 commit comments

Comments
 (0)
Please sign in to comment.