diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2016-10-24 09:56:12 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2016-10-24 09:56:12 +0200 |
commit | 6ebe3b99fe7b1c1eb199b5cee0de879fcdf8ee42 (patch) | |
tree | 0b2291676d82de73629e9cbd74209eebbf0c1627 | |
parent | 1c9bdfad03ab7247ccb55158988ab28929738681 (diff) |
Deal with unloaded apartments.
-rw-r--r-- | init.lua | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -943,8 +943,13 @@ if apartment_give_player then minetest.register_on_newplayer(function(player) for k,v in pairs( apartment.apartments ) do if (v.owner == '' and v.category == 'apartment') then + local meta = minetest.get_meta( v.pos ); local node = minetest.get_node( v.pos ); + if node.name == "ignore" then -- deal with unloaded nodes. + minetest.get_voxel_manip():read_from_map(pos, pos) + node = minetest.get_node(pos) + end if (node.name == 'apartment:apartment_free' and apartment.rent( v.pos, player:get_player_name(), nil, player )) then player:moveto( v.pos, false); meta:set_string( 'formspec', apartment.get_formspec( v.pos, player )); |