diff --git a/.luacheckrc b/.luacheckrc index 655b9fe..936b5e1 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -45,7 +45,7 @@ read_globals = { fields = {"copy"}, }, mtt = { - fields = {"join_player", "register"}, + fields = {"join_player", "leave_player", "register"}, } } diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index d374124..3c39a14 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -1,3 +1,5 @@ +when: + - event: push steps: luacheck: image: pipelinecomponents/luacheck @@ -10,6 +12,7 @@ steps: - apk add git - mkdir test/worldmods - git clone --depth 1 https://github.com/BuckarooBanzay/mtt test/worldmods/mtt + - git clone --depth 1 https://github.com/OgelGames/fakelib test/worldmods/fakelib - git clone --depth 1 https://codeberg.org/Wuzzy/minetest_doc test/worldmods/doc - git clone --depth 1 https://git.bananach.space/advtrains.git test/worldmods/advtrains - git clone --depth 1 https://git.bananach.space/basic_trains.git test/worldmods/basic_trains diff --git a/mod.conf b/mod.conf index aeef199..0c9e39b 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,5 @@ name=advtrains_doc_integration title=Documentation system integration for Advtrains depends=advtrains,doc -optional_depends=advtrains_attachment_offset_patch,advtrains_livery_database,dlxtrains,doc_items,mtt,multi_component_liveries,techage +optional_depends=advtrains_attachment_offset_patch,advtrains_livery_database,dlxtrains,doc_items,fakelib,mtt,multi_component_liveries,techage supported_games=*,minetest_game diff --git a/mtt.lua b/mtt.lua index 035a7de..59717ed 100644 --- a/mtt.lua +++ b/mtt.lua @@ -1,11 +1,11 @@ if doc then mtt.register("wagon information formspec", function(cb) - local player = mtt.join_player("singleplayer") + mtt.join_player("singleplayer") for k in pairs(advtrains_doc_integration.prototypes) do print("Found wagon prototype: " .. k) doc.show_entry("singleplayer", "advtrains_wagons", k, true) end - player:leave() + mtt.leave_player("singleplayer") cb() end) end