Fix crash on map creation

This commit is contained in:
Nils Dagsson Moskopp 2022-05-22 02:24:22 +02:00
parent 741f9ede21
commit 78b27ce22b
Signed by untrusted user who does not match committer: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 9 additions and 9 deletions

View File

@ -536,6 +536,8 @@ xmaps.load_map_item = function(itemstack)
local texture = xmaps.load_map(map_id)
local meta_xpos = meta:get_string("xmaps:xpos")
if texture and "" ~= meta_xpos then
local meta_minp = meta:get_string("xmaps:minp")
assert( "" ~= meta_minp )
local minp = minetest.string_to_pos(meta_minp)
@ -544,8 +546,6 @@ xmaps.load_map_item = function(itemstack)
assert( "" ~= meta_maxp )
local maxp = minetest.string_to_pos(meta_maxp)
local meta_xpos = meta:get_string("xmaps:xpos")
if "" ~= meta_xpos then
local xpos = minetest.string_to_pos(meta_xpos)
local x_x = xpos.x - minp.x - 4
local x_z = maxp.z - xpos.z - 4