Give home-saving function a more accurate name
This commit is contained in:
parent
014ad06d9c
commit
bea79acf10
6
init.lua
6
init.lua
@ -31,7 +31,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
end
|
||||
end)
|
||||
|
||||
local function update_homes()
|
||||
local function save_homes()
|
||||
local homes = maggems_landmark.homes
|
||||
modstore:set_string("homes", minetest.encode_base64(homes:to_string()))
|
||||
end
|
||||
@ -66,13 +66,13 @@ minetest.register_node("maggems_landmark:home", {
|
||||
local pos2 = {x=pos.x+4,y=pos.y+4,z=pos.z+4}
|
||||
local id = homes:insert_area(pos1, pos2, minetest.serialize(pos))
|
||||
assert(id ~= nil)
|
||||
update_homes()
|
||||
save_homes()
|
||||
meta:set_int("maggems_landmark:home_id", id)
|
||||
end,
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
local homes = maggems_landmark.homes
|
||||
homes:remove_area(oldmetadata.fields["maggems_landmark:home_id"])
|
||||
update_homes()
|
||||
save_homes()
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, sender)
|
||||
local meta = minetest.get_meta(pos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user