Used vector.offset instead of add/subtract

This commit is contained in:
Dehydrate6684 2023-10-10 09:39:16 +08:00
parent 0c48a46f7c
commit 23468cc2dd
Signed by untrusted user: Dehydrate6684
GPG Key ID: 5926A2FA9B7653EF
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ end
---@param ladder integer The param2 value of the ladder.
---@param event "place" | "destruct" The place or destruct event.
local function update_trapdoor(pos, ladder, event)
local top_pos = vector.add(pos, { x = 0, y = 1, z = 0 })
local top_pos = vector.offset(pos, 0, 1, 0)
local top_node = minetest.get_node_or_nil(top_pos)

View File

@ -73,7 +73,7 @@ function mcl_doors:register_trapdoor(name, def)
else
minetest.sound_play(def.sound_open, { pos = pos, gain = 0.3, max_hear_distance = 16 }, true)
local bottom_node = minetest.get_node_or_nil(vector.subtract(pos, { x = 0, y = 1, z = 0 }))
local bottom_node = minetest.get_node_or_nil(vector.offset(pos, 0, -1, 0))
local name_end = "_open"
-- Checking if there is something underneath the trapdoor