Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #92 from khonkhortisan/lazypull
Browse files Browse the repository at this point in the history
Round movestone position, don't forget last pull
  • Loading branch information
Uberi committed Apr 8, 2013
2 parents e45a2a5 + f1a327a commit c08e868
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mesecons_movestones/init.lua
Expand Up @@ -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
Expand Down Expand Up @@ -172,14 +172,16 @@ 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
local name = minetest.env:get_node(pos).name
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()
Expand Down

0 comments on commit c08e868

Please sign in to comment.