Add compatibility with cursed_world mod. Stay in cursed_world if already there.
parent
d5366f1120
commit
5d76bebe23
|
@ -0,0 +1,2 @@
|
||||||
|
default
|
||||||
|
cursed_world?
|
14
init.lua
14
init.lua
|
@ -15,8 +15,18 @@ minetest.register_chatcommand("spawn", {
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
if pos.x>-20 and pos.x<20 and pos.y>-20 and pos.z>-20 and pos.z<20 then
|
if pos.x>-20 and pos.x<20 and pos.z>-20 and pos.z<20 then
|
||||||
|
minetest.chat_send_player(name, "Already close to spawn!")
|
||||||
|
elseif _G['cursed_world'] ~= nil and --check global table for cursed_world mod
|
||||||
|
cursed_world.location_y and cursed_world.dimension_y and
|
||||||
|
pos.y < (cursed_world.location_y + cursed_world.dimension_y) and --if player is in cursed world, stay in cursed world
|
||||||
|
pos.y > (cursed_world.location_y - cursed_world.dimension_y)
|
||||||
|
then --check global table for cursed_world mod
|
||||||
|
--minetest.chat_send_player(name, "T"..(cursed_world.location_y + cursed_world.dimension_y).." "..(cursed_world.location_y - cursed_world.dimension_y))
|
||||||
|
local spawn_pos = spawn_command.pos;
|
||||||
|
spawn_pos.y = spawn_pos.y + cursed_world.location_y;
|
||||||
|
player:setpos(spawn_pos)
|
||||||
|
minetest.chat_send_player(name, "Teleported to spawn!")
|
||||||
else
|
else
|
||||||
player:setpos(spawn_command.pos)
|
player:setpos(spawn_command.pos)
|
||||||
minetest.chat_send_player(name, "Teleported to spawn!")
|
minetest.chat_send_player(name, "Teleported to spawn!")
|
||||||
|
|
Loading…
Reference in New Issue