10 Commits

3 changed files with 19 additions and 22 deletions

View File

@ -1,20 +0,0 @@
name: build
on: [push, pull_request]
jobs:
luacheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qqq luarocks
- name: Install LuaCheck and pre-commit
run: |
pip3 install pre-commit
luarocks install --local luacheck
- name: Run LuaCheck with pre-commit
run: |
export PATH="$HOME/.luarocks/bin:$PATH"
pre-commit run --all-files

16
.travis.yml Normal file
View File

@ -0,0 +1,16 @@
dist: bionic
language: python
python:
- 3.7.1
install:
- sudo apt-get update -qq
- sudo apt-get install -qqq luarocks
- pip3 install pre-commit
- luarocks install --local luacheck
script:
# All linters are run with pre-commit hooks
- export PATH="$HOME/.luarocks/bin:$PATH"
- pre-commit run --all-files

View File

@ -35,8 +35,7 @@ local function add_gauge(player)
end
end
-- credit:
-- https://github.com/minetest/minetest/blob/master/builtin/game/statbars.lua#L31-L37
-- credit: https://github.com/minetest/minetest/blob/6de8d77e17017cd5cc7b065d42566b6b1cd076cc/builtin/game/statbars.lua#L30-L37
local function scaleToDefault(player, field)
-- Scale "hp" or "breath" to supported amount
local current = player["get_" .. field](player)
@ -95,3 +94,5 @@ if enabled then
minetest.after(1, add_gauge, player)
end)
end
minetest.log("action", "[gauges] loaded.")