mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-22 16:09:33 +01:00
Fix portal corner metadata being able to be killed
This was possible by re-using the same frame for multiple portals.
This commit is contained in:
parent
3e3e9f3931
commit
5c5c2ea109
2 changed files with 16 additions and 0 deletions
|
@ -199,6 +199,14 @@ local function move_check2(p1, max, dir)
|
||||||
if minetest.get_node(p).name ~= portal_frame then
|
if minetest.get_node(p).name ~= portal_frame then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
-- Abort if any of the portal frame blocks already has metadata.
|
||||||
|
-- This mod does not yet portals which neighbor each other directly.
|
||||||
|
-- TODO: Reorganize the way how portal frame coordinates are stored.
|
||||||
|
local meta = minetest.get_meta(p)
|
||||||
|
local p1 = meta:get_string("portal_frame1")
|
||||||
|
if minetest.string_to_pos(p1) ~= nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -196,6 +196,14 @@ local function move_check(p1, max, dir)
|
||||||
if minetest.get_node(p).name ~= "mcl_core:obsidian" then
|
if minetest.get_node(p).name ~= "mcl_core:obsidian" then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
-- Abort if any of the portal frame blocks already has metadata.
|
||||||
|
-- This mod does not yet portals which neighbor each other directly.
|
||||||
|
-- TODO: Reorganize the way how portal frame coordinates are stored.
|
||||||
|
local meta = minetest.get_meta(p)
|
||||||
|
local p1 = meta:get_string("portal_frame1")
|
||||||
|
if minetest.string_to_pos(p1) ~= nil then
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue