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 = {
|
surface = {
|
||||||
name = "surface",
|
name = "surface",
|
||||||
label = "Surface",
|
label = "Surface",
|
||||||
max = vector.new(-31000, -5000, -31000),
|
min = vector.new(-31000, -5000, -31000),
|
||||||
min = vector.new(31000, 1000, 31000)
|
max = vector.new(31000, 1000, 31000),
|
||||||
|
-- TODO: Find a better way to handle admin realm transitions.
|
||||||
|
waypoint = vector.new(0, 30, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -33,9 +35,7 @@ end
|
||||||
|
|
||||||
function ns.update_realm(m)
|
function ns.update_realm(m)
|
||||||
local realm = ns.realms[ns.get_realm_at_pos(m.object:get_pos())]
|
local realm = ns.realms[ns.get_realm_at_pos(m.object:get_pos())]
|
||||||
if realm.sky then
|
m.object:set_sky(realm.sky)
|
||||||
m.object:set_sky(realm.sky)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function ns.check_position(m)
|
function ns.check_position(m)
|
||||||
|
|
@ -45,7 +45,9 @@ end
|
||||||
|
|
||||||
minetest.register_chatcommand("realm", {
|
minetest.register_chatcommand("realm", {
|
||||||
func = function(name, args)
|
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
|
||||||
ns.update_realm(rgt.players[name])
|
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
|
end
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue