forked from mt-mods/missions
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrate.lua
34 lines (25 loc) · 764 Bytes
/
migrate.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
missions.migrate_mission_block = function(pos, meta)
local inv = meta:get_inventory()
if inv:get_size("main") ~= 8 then
minetest.log("info", "[missions] Migrated mission-block inventory (v1) at pos: " .. minetest.pos_to_string(pos))
inv:set_size("main", 8)
end
if meta:get_int("hidden") == nil then
meta:set_int("hidden", 0)
end
if meta:get_int("nointeract") == nil then
meta:set_int("nointeract", 0)
end
if meta:get_int("valid") == nil then
meta:set_int("valid", 1)
end
if meta:get_string("validationresult") == nil then
meta:set_string("validationresult", "")
end
if meta:get_int("successcount") == nil then
meta:set_int("successcount", 0)
end
if meta:get_int("failcount") == nil then
meta:set_int("failcount", 0)
end
end