From 2d8d2886428705e3cfdb1d761d993412808a260d Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Mon, 31 May 2021 21:02:14 -0300 Subject: [PATCH] Fix error on table.concat function (#33) --- data/lib/core/functions/tables.lua | 4 ++-- data/npclua/a_sweaty_cyclops.lua | 2 +- data/npclua/captain_bluebear.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/lib/core/functions/tables.lua b/data/lib/core/functions/tables.lua index e24b62d4b59..449ecedb10c 100644 --- a/data/lib/core/functions/tables.lua +++ b/data/lib/core/functions/tables.lua @@ -104,7 +104,7 @@ function table.unserialize(str) return loadstring("return " .. str)() end -function table.concat(tableA, tableB) +function table.join(tableA, tableB) local result = {unpack(tableA)} table.move(tableB, 1, #tableB, #result + 1, result) return result @@ -128,4 +128,4 @@ function Set(list) local set = {} for _, l in ipairs(list) do set[l] = true end return set -end \ No newline at end of file +end diff --git a/data/npclua/a_sweaty_cyclops.lua b/data/npclua/a_sweaty_cyclops.lua index 89a9ec80e8a..9ce3b03fd40 100644 --- a/data/npclua/a_sweaty_cyclops.lua +++ b/data/npclua/a_sweaty_cyclops.lua @@ -235,7 +235,7 @@ npcType.onMove = function(npc, creature, fromPosition, toPosition) end npcType.onSay = function(npc, creature, type, message) - return npc:processOnSay(message, creature, table.concat(interactions, getCraftInteractions(craftConfigs))) + return npc:processOnSay(message, creature, table.join(interactions, getCraftInteractions(craftConfigs))) end npcType:register(npcConfig) diff --git a/data/npclua/captain_bluebear.lua b/data/npclua/captain_bluebear.lua index 6c5f2035b0c..318c9a6d21f 100644 --- a/data/npclua/captain_bluebear.lua +++ b/data/npclua/captain_bluebear.lua @@ -116,7 +116,7 @@ npcType.onMove = function(npc, creature, fromPosition, toPosition) end npcType.onSay = function(npc, creature, type, message) - local npcInteractions = table.concat(replyInteractions, getTravelInteractions(creature, destinations, travelMessages)) + local npcInteractions = table.join(replyInteractions, getTravelInteractions(creature, destinations, travelMessages)) return npc:processOnSay(message, creature, npcInteractions) end