Allow returning to the surface realm
This commit is contained in:
parent
9a9b0bb85f
commit
1d21346f05
1 changed files with 9 additions and 7 deletions
|
|
@ -11,8 +11,10 @@ rgt_realms = {
|
|||
surface = {
|
||||
name = "surface",
|
||||
label = "Surface",
|
||||
max = vector.new(-31000, -5000, -31000),
|
||||
min = vector.new(31000, 1000, 31000)
|
||||
min = vector.new(-31000, -5000, -31000),
|
||||
max = vector.new(31000, 1000, 31000),
|
||||
-- TODO: Find a better way to handle admin realm transitions.
|
||||
waypoint = vector.new(0, 30, 0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -33,10 +35,8 @@ end
|
|||
|
||||
function ns.update_realm(m)
|
||||
local realm = ns.realms[ns.get_realm_at_pos(m.object:get_pos())]
|
||||
if realm.sky then
|
||||
m.object:set_sky(realm.sky)
|
||||
end
|
||||
end
|
||||
|
||||
function ns.check_position(m)
|
||||
|
||||
|
|
@ -45,7 +45,9 @@ end
|
|||
|
||||
minetest.register_chatcommand("realm", {
|
||||
func = function(name, args)
|
||||
minetest.get_player_by_name(name):set_pos(ns.realms["outback"].min +(ns.realms["outback"].max -ns.realms["outback"].min) /2)
|
||||
if ns.realms[args] and args ~= "void" then
|
||||
minetest.get_player_by_name(name):set_pos(ns.realms[args].waypoint or (ns.realms[args].min +(ns.realms[args].max -ns.realms[args].min) /2))
|
||||
ns.update_realm(rgt.players[name])
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue