Use new lobby API for switching to singleplayer mode

master
whats_his_face 2022-05-04 21:00:51 -05:00
parent 4f94d18fff
commit 28dea0a7f1
1 changed files with 1 additions and 10 deletions

View File

@ -342,16 +342,7 @@ minetest.register_node('lobby:button_1', {
color = {a = 0, r = 255, g = 255, b = 255}
})
puncher:set_properties({visual_size = {x = 0, y = 0}, collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.7, 0.3}})
player_attributes:set_string('mode', 'solo')
local privs = minetest.get_player_privs(name)
local player_inv = puncher:get_inventory()
player_inv:set_list('main', {})
player_inv:set_size('main', 16)
privs.fly = nil
privs.fast = nil
privs.creative = nil
privs.areas = nil
minetest.set_player_privs(name, privs)
lobby.builder_to_player(puncher)
puncher:set_pos(game_pos)
lobby.game[name] = map_id..'_solo'
minetest.chat_send_player(name, 'Travel back to the lobby with the /lobby chat command.')