From 4d82af8f9da22eef9666c47a79a6429b76dd0144 Mon Sep 17 00:00:00 2001 From: David Leal Date: Sat, 5 Sep 2020 20:39:34 -0500 Subject: [PATCH] Add GitHub workflow and LuaCheck (#5) * Add GitHub workflow and LuaCheck * Fix warning reported by LuaCheck * Add build status and license badge * Remove unused variable (fix warning) * Revert "Remove unused variable (fix warning)" --- .github/workflows/build.yml | 11 +++++++++++ .luacheckrc | 15 +++++++++++++++ README.md | 3 +++ nodebox.lua | 2 +- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100644 .luacheckrc diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..817e409 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,11 @@ +on: [push, pull_request] +name: build +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: lint + uses: Roang-zero1/factorio-mod-luacheck@master + with: + luacheckrc_url: "" diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..14397b2 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,15 @@ +unused_args = false +allow_defined_top = true +max_line_length = 999 + +read_globals = { + string = {fields = {"split", "trim"}}, + table = {fields = {"copy", "getn", "indexof"}}, + + "minetest", "DIR_DELIM", + "vector", "VoxelArea", +} + +ignore = { + "vertList", +} diff --git a/README.md b/README.md index e6d0902..73a9a27 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Meshport (Minetest Mesh Exporter) +[![Build status](https://github.com/random-geek/meshport/workflows/build/badge.svg)](https://github.com/random-geek/meshport/actions) +[![License](https://img.shields.io/badge/license-LGPLv3.0%2B-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0.en.html) + ![screenshot](screenshot.png) Meshport is a mod which allows easy exporting of scenes from Minetest to `.obj` files, complete with materials and textures. These models can be imported directly into Blender or another 3D program for rendering and animation. diff --git a/nodebox.lua b/nodebox.lua index af9d537..b566a00 100644 --- a/nodebox.lua +++ b/nodebox.lua @@ -98,7 +98,7 @@ function meshport.Boxes:to_faces(nodeTiles, pos, facedir) {{x = b[4], y = b[2]}, {x = b[4], y = b[5]}, {x = b[1], y = b[5]}, {x = b[1], y = b[2]}}, -- Z- } - local tileIdx, vertNorm + local vertNorm for i = 1, 6 do -- Fix offset texture coordinates.