forked from minetest-mods/hbsprint
Compare commits
3 Commits
b3773c0470
...
master
Author | SHA1 | Date | |
---|---|---|---|
92a1e0cddb | |||
f566d0ff26 | |||
1fe580a210 |
11
.github/workflows/build.yml
vendored
Normal file
11
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
on: [push, pull_request]
|
||||||
|
name: build
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: lint
|
||||||
|
uses: Roang-zero1/factorio-mod-luacheck@master
|
||||||
|
with:
|
||||||
|
luacheckrc_url: ""
|
19
.luacheckrc
Normal file
19
.luacheckrc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
allow_defined_top = true
|
||||||
|
unused_args = false
|
||||||
|
max_line_length = false
|
||||||
|
|
||||||
|
read_globals = {
|
||||||
|
string = {fields = {"split", "trim"}},
|
||||||
|
table = {fields = {"copy", "getn"}},
|
||||||
|
|
||||||
|
"player_monoids",
|
||||||
|
"playerphysics",
|
||||||
|
"hb",
|
||||||
|
"vector",
|
||||||
|
"hunger_ng",
|
||||||
|
}
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"minetest",
|
||||||
|
"hbhunger"
|
||||||
|
}
|
6
init.lua
6
init.lua
@ -130,8 +130,8 @@ local function is_walkable(ground)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function create_particles(player, name, ground)
|
local function create_particles(player, name, ground)
|
||||||
local def = minetest.registered_nodes[ground.name]
|
local def = minetest.registered_nodes[ground.name] or {}
|
||||||
local tile = def.tiles[1] or def.inventory_image
|
local tile = def.tiles and def.tiles[1] or def.inventory_image
|
||||||
if type(tile) == "table" then
|
if type(tile) == "table" then
|
||||||
tile = tile.name
|
tile = tile.name
|
||||||
end
|
end
|
||||||
@ -237,7 +237,7 @@ local function sprint_step(player, dtime)
|
|||||||
if (player_stamina > 0 and hunger > starve_limit and ground) or fast then
|
if (player_stamina > 0 and hunger > starve_limit and ground) or fast then
|
||||||
start_sprint(player)
|
start_sprint(player)
|
||||||
if stamina and not fast then drain_stamina(player) end
|
if stamina and not fast then drain_stamina(player) end
|
||||||
if starve then drain_hunger(player, name) end
|
if starve and not fast then drain_hunger(player, name) end
|
||||||
if breath and not fast and breath_timer[name] >= 2 then
|
if breath and not fast and breath_timer[name] >= 2 then
|
||||||
drain_breath(player)
|
drain_breath(player)
|
||||||
breath_timer[name] = 0
|
breath_timer[name] = 0
|
||||||
|
Reference in New Issue
Block a user