forked from Sokomine/yl_speak_up
check if the player is allowed to edit the npc before applying changes
This commit is contained in:
parent
f3573e746f
commit
f8138908bc
@ -59,6 +59,11 @@ yl_speak_up.edit_mode_apply_changes = function(pname, fields)
|
||||
local d_id = yl_speak_up.speak_to[pname].d_id
|
||||
local dialog = yl_speak_up.speak_to[pname].dialog
|
||||
|
||||
-- check if the player is allowed to edit this NPC
|
||||
if(not(yl_speak_up.may_edit_npc(minetest.get_player_by_name(pname), n_id))) then
|
||||
return
|
||||
end
|
||||
|
||||
-- this way we can store the actual changes and present them to the player for saving
|
||||
if(not(yl_speak_up.npc_was_changed[ n_id ])) then
|
||||
yl_speak_up.npc_was_changed[ n_id ] = {}
|
||||
|
Loading…
Reference in New Issue
Block a user