diff --git a/minetestforfun_game/mods/beds/functions.lua b/minetestforfun_game/mods/beds/functions.lua index 5b2f5406..f57a3765 100755 --- a/minetestforfun_game/mods/beds/functions.lua +++ b/minetestforfun_game/mods/beds/functions.lua @@ -183,6 +183,11 @@ end) -- respawn player at bed if enabled and valid position is found minetest.register_on_respawnplayer(function(player) + --MFF DEBUT crabman(8/01/2016 ) respawn player in special area(event) if a spawn is set. + if ((minetest.get_modpath("areas") ~= nil) and (areas:onRespawn(player))) then + return true + end + if not enable_respawn then return false end diff --git a/mods/areas/api.lua b/mods/areas/api.lua index c3312056..7f9c4a4c 100755 --- a/mods/areas/api.lua +++ b/mods/areas/api.lua @@ -136,6 +136,7 @@ end --MFF DEBUT crabman(17/09/2015 ) respawn player in special area(event) if a spawn is set. +--1 party (2 party in beds mod) local dead_players = {} minetest.register_on_dieplayer(function(player) local player_name = player:get_player_name() @@ -147,7 +148,7 @@ minetest.register_on_dieplayer(function(player) end) -minetest.register_on_respawnplayer(function(player) +function areas:onRespawn(player) local player_name = player:get_player_name() if not player_name or not dead_players[player_name] then return false end local pos = dead_players[player_name] @@ -161,5 +162,5 @@ minetest.register_on_respawnplayer(function(player) end end return false -end) +end --FIN