mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-02-02 21:30:20 +01:00
Fix crash when getting static_spawnpoint from minetest.conf
- Fix crashs when teleporting back to the real world - Remove pranks in to_hell/from_hell - Solves #252
This commit is contained in:
parent
44ca73d9f2
commit
f366bc17fd
@ -94,15 +94,13 @@ minetest.register_chatcommand("to_hell", {
|
|||||||
params = "",
|
params = "",
|
||||||
description = "Send someone to hell",
|
description = "Send someone to hell",
|
||||||
func = function(name, pname)
|
func = function(name, pname)
|
||||||
if not minetest.check_player_privs(name, {nether=true}) then
|
if not minetest.get_player_privs(name).nether then
|
||||||
local self_player = minetest.get_player_by_name(name)
|
local self_player = minetest.get_player_by_name(name)
|
||||||
if self_player then
|
if self_player then
|
||||||
minetest.chat_send_player(name, "You can't send anyone to hell, go to hell instead")
|
return false, "You can't send anyone to hell."
|
||||||
player_to_nether(self_player)
|
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name, "Something went wrong.")
|
return false, "Something went wrong."
|
||||||
end
|
end
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
if not player_exists(pname) then
|
if not player_exists(pname) then
|
||||||
pname = name
|
pname = name
|
||||||
@ -122,15 +120,13 @@ minetest.register_chatcommand("from_hell", {
|
|||||||
params = "",
|
params = "",
|
||||||
description = "Extract from hell",
|
description = "Extract from hell",
|
||||||
func = function(name, pname)
|
func = function(name, pname)
|
||||||
if not minetest.check_player_privs(name, {nether=true}) then
|
if not minetest.get_player_privs(name).nether then
|
||||||
local self_player = minetest.get_player_by_name(name)
|
local self_player = minetest.get_player_by_name(name)
|
||||||
if self_player then
|
if self_player then
|
||||||
minetest.chat_send_player(name, "You can't send anyone to hell, go to hell instead")
|
return false, "You can't extract anyone from hell"
|
||||||
player_to_nether(self_player)
|
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name, "Something went wrong.")
|
return false, "Something went wrong."
|
||||||
end
|
end
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
if not player_exists(pname) then
|
if not player_exists(pname) then
|
||||||
pname = name
|
pname = name
|
||||||
@ -542,7 +538,7 @@ function nether_port(player, pos)
|
|||||||
local pos_togo = {x = 0, y = 35, z = -7}
|
local pos_togo = {x = 0, y = 35, z = -7}
|
||||||
if minetest.setting_getbool("static_spawnpoint") ~= nil then
|
if minetest.setting_getbool("static_spawnpoint") ~= nil then
|
||||||
local stsp_conf = minetest.setting_get("static_spawnpoint")
|
local stsp_conf = minetest.setting_get("static_spawnpoint")
|
||||||
pos_togo = {x = stsp_conf:split(",")[1],y = stsp_conf:split(",")[2],z = stsp_conf:split(",")[3]}
|
pos_togo = minetest.string_to_pos(stsp_conf)
|
||||||
end
|
end
|
||||||
player:moveto(pos_togo)
|
player:moveto(pos_togo)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user