1
0
Fork 0

Fix portal corner metadata being able to be killed

This was possible by re-using the same frame for multiple portals.
objects
Wuzzy 2017-08-17 04:36:08 +02:00
parent 3e3e9f3931
commit 5c5c2ea109
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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