mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-06 08:37:30 +01:00
Replace vector.add(pos, {}) with vector.offset
This commit is contained in:
parent
0212969962
commit
43ccb21302
@ -2,28 +2,27 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
|||||||
|
|
||||||
local get_node = minetest.get_node
|
local get_node = minetest.get_node
|
||||||
|
|
||||||
|
local rules_down = {{ x = 0, y = 1, z = 0, spread = true }}
|
||||||
|
local rules_up = {{ x = 0, y = -1, z = 0, spread = true }}
|
||||||
local function get_rules_flat(node)
|
local function get_rules_flat(node)
|
||||||
local rule = core.facedir_to_dir((node.param2+2)%4)
|
local rule = core.facedir_to_dir((node.param2+2)%4)
|
||||||
rule.spread = true
|
rule.spread = true
|
||||||
return {rule}
|
return {rule}
|
||||||
end
|
end
|
||||||
|
|
||||||
local rules_down = {{ x = 0, y = 1, z = 0, spread = true }}
|
|
||||||
local rules_up = {{ x = 0, y = -1, z = 0, spread = true }}
|
|
||||||
|
|
||||||
local function observer_look_position(pos, node)
|
local function observer_look_position(pos, node)
|
||||||
local node = node or get_node(pos)
|
local node = node or get_node(pos)
|
||||||
|
|
||||||
if node.name == "mcl_observers:observer_up_off" or node.name == "mcl_observers:observer_up_on" then
|
if node.name == "mcl_observers:observer_up_off" or node.name == "mcl_observers:observer_up_on" then
|
||||||
return vector.add(pos, {x=0, y=1, z=0})
|
return vector.offset(pos, 0, 1, 0)
|
||||||
elseif node.name == "mcl_observers:observer_down_off" or node.name == "mcl_observers:observer_down_on" then
|
elseif node.name == "mcl_observers:observer_down_off" or node.name == "mcl_observers:observer_down_on" then
|
||||||
return vector.add(pos, {x=0, y=-1, z=0})
|
return vector.offset(pos, 0, -1, 0)
|
||||||
else
|
else
|
||||||
return vector.add(pos, minetest.facedir_to_dir(node.param2))
|
return vector.add(pos, minetest.facedir_to_dir(node.param2))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Vertical orientation (CURRENTLY DISABLED)
|
-- Vertical orientation
|
||||||
local function observer_orientate(pos, placer)
|
local function observer_orientate(pos, placer)
|
||||||
-- Not placed by player
|
-- Not placed by player
|
||||||
if not placer then return end
|
if not placer then return end
|
||||||
|
Loading…
Reference in New Issue
Block a user