if an NPC supports follow/stand/wander is now a config option

This commit is contained in:
Sokomine 2022-07-21 17:40:15 +02:00
parent 72c68fd261
commit 5432064ae0
2 changed files with 9 additions and 1 deletions

View File

@ -67,6 +67,12 @@ yl_speak_up.mob_skins["yl_speak_up:human"] = {
"yl_speak_up_main_default.png", "some_skin.png", "2022_06_28_the-lonley-lumberjack-20494635.png"}
-- some mobs (in particular from mobs_redo) can switch between follow (their owner),
-- stand and walking when they're right-clicked; emulate this behaviour for NPC in
-- this list
yl_speak_up.emulate_orders_on_rightclick = {
"mobs_npc:npc", "mobs_npc:igor", "mobs_npc:trader"}
-- some properties from external NPC can be edited and changed (they have the self. prefix),
-- and it is possible to react to property changes with handlers;

View File

@ -884,7 +884,9 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec
end
-- mobs_redo based NPC can follow, stand or wander around
if(luaentity and luaentity.order and may_edit_npc) then
if(luaentity and luaentity.order and may_edit_npc
-- not all mobs need or support this feature
and table.indexof(yl_speak_up.emulate_orders_on_rightclick, luaentity.name) > -1) then
if(luaentity.order ~= "follow") then
h = yl_speak_up.add_edit_button_fs_talkdialog(formspec, h,
"order_follow",