Fix a few accidental globals
This commit is contained in:
parent
e7fa4db354
commit
843ec6d206
6
rail.lua
6
rail.lua
@ -135,7 +135,7 @@ function get_railstatus(fppos, direction, speed)
|
||||
end
|
||||
|
||||
-- Use rounded position for all lookups and calculations in here
|
||||
pos = vector.round(fppos)
|
||||
local pos = vector.round(fppos)
|
||||
|
||||
local current_node = minetest.get_node(pos)
|
||||
|
||||
@ -147,7 +147,7 @@ function get_railstatus(fppos, direction, speed)
|
||||
return {railtype="inv"}
|
||||
end
|
||||
|
||||
status = {}
|
||||
local status = {}
|
||||
|
||||
-- Get all surrounding nodes. This builds a little cache of all the
|
||||
-- surrounding nodes we might need to look at.
|
||||
@ -164,7 +164,7 @@ function get_railstatus(fppos, direction, speed)
|
||||
surrounds[name] = minetest.get_node(pos)
|
||||
surrounds[name.."_pos"] = pos
|
||||
end
|
||||
surrounds = {}
|
||||
local surrounds = {}
|
||||
getsur("x_prev", {x=pos.x-1,y=pos.y,z=pos.z}, surrounds)
|
||||
getsur("x_next", {x=pos.x+1,y=pos.y,z=pos.z}, surrounds)
|
||||
getsur("z_prev", {x=pos.x,y=pos.y,z=pos.z-1}, surrounds)
|
||||
|
Loading…
x
Reference in New Issue
Block a user