Fix some right click actions being allowed for wrong player too

This commit is contained in:
sapier 2014-08-24 19:18:19 +02:00
parent 14c3c444f5
commit cd7f4ef330
2 changed files with 12 additions and 5 deletions

View File

@ -141,9 +141,6 @@ function mobf_factions.config_check(entity)
if not mobf_rtd.factions_available then
return false
end
if entity.dynamic_data.spawning.spawner ~= nil then
return true
end
return false
end
@ -319,7 +316,8 @@ function mobf_factions.show_mob_factions_menu(new_id,menu_data)
else
formspec = "label[0,0;This is not your mob keep away!]"
formspec = "size[4,1]label[0,0;This is not your mob keep away!]" ..
"button_exit[1,0.75;2,0.5;btn_exit;Okay Okay!]"
end
--show formspec

View File

@ -467,6 +467,15 @@ end
function mobf_path.mob_rightclick_callback(entity,player)
local playername = player:get_player_name()
if entity.dynamic_data.spawning.spawner ~= playername then
core.show_formspec(playername,"mobf:path:add_path_to_entity",
"size[4,1]label[0,0;This is not your mob keep away!]" ..
"button_exit[1,0.75;2,0.5;btn_exit;Okay Okay!]")
return
end
if entity.dynamic_data.patrol_state_before ~= nil then
mobf_path.switch_patrol(entity,nil,nil)
else
@ -491,7 +500,7 @@ function mobf_path.mob_rightclick_callback(entity,player)
buttons
--show formspec
minetest.show_formspec(playername,"mobf:path:add_path_to_entity",formspec)
core.show_formspec(playername,"mobf:path:add_path_to_entity",formspec)
end
end