From 9dbaa5f4f6635d27768190c1fd5c8c6f4bc3b150 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 21 Feb 2016 09:15:43 +0100 Subject: [PATCH 1/2] Log the "Pipeworks loaded!" message to infostream instead of printing it --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 835ab62..d3ad576 100644 --- a/init.lua +++ b/init.lua @@ -150,4 +150,4 @@ end minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty") -print("Pipeworks loaded!") +minetest.log("info", "Pipeworks loaded!") From c2fe5fe95668ed34695cf9a0784e34c939148910 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Thu, 14 Jul 2016 12:22:35 +0200 Subject: [PATCH 2/2] Make pipeworks.table_extend easier to read In my opinion this clarifies that tbl2 is attached at the end of tbl --- common.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common.lua b/common.lua index 0f8c34c..a2a8cea 100644 --- a/common.lua +++ b/common.lua @@ -86,10 +86,9 @@ function pipeworks.table_contains(tbl, element) end function pipeworks.table_extend(tbl, tbl2) - local index = #tbl + 1 - for _, elt in ipairs(tbl2) do - tbl[index] = elt - index = index + 1 + local oldlength = #tbl + for i = 1,#tbl2 do + tbl[oldlength + i] = tbl2[i] end end