Fix map editor not saving team flag positions

Previously, meta was written to map.conf *before* setting the aforementioned values
This commit is contained in:
ClobberXD 2018-08-31 17:41:35 +05:30 committed by rubenwardy
parent 72c5afab55
commit 6375bb2cf0

View file

@ -281,7 +281,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
meta:set("rotation", center_barrier_rot == 0 and "x" or "z") meta:set("rotation", center_barrier_rot == 0 and "x" or "z")
meta:set("r", center.r) meta:set("r", center.r)
meta:set("h", center.h) meta:set("h", center.h)
meta:write()
for _, flags in pairs(flag_positions) do for _, flags in pairs(flag_positions) do
local pos = vector.subtract(flags, center) local pos = vector.subtract(flags, center)
@ -296,6 +295,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
meta:set("team." .. idx .. ".color", pos.z > 0 and "red" or "blue") meta:set("team." .. idx .. ".color", pos.z > 0 and "red" or "blue")
meta:set("team." .. idx .. ".pos", minetest.pos_to_string(pos)) meta:set("team." .. idx .. ".pos", minetest.pos_to_string(pos))
end end
meta:write()
minetest.after(0.1, function() minetest.after(0.1, function()
local filepath = path .. mapname .. ".mts" local filepath = path .. mapname .. ".mts"