Skip to content

Commit

Permalink
Fix error on table.concat function (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Jun 1, 2021
1 parent be4ca5f commit 2d8d288
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data/lib/core/functions/tables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -128,4 +128,4 @@ function Set(list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
return set
end
end
2 changes: 1 addition & 1 deletion data/npclua/a_sweaty_cyclops.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion data/npclua/captain_bluebear.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2d8d288

Please sign in to comment.