diff --git a/edit_mode_apply_changes.lua b/edit_mode_apply_changes.lua index 4bd6747..579aae6 100644 --- a/edit_mode_apply_changes.lua +++ b/edit_mode_apply_changes.lua @@ -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 ] = {}