luacheck and fixes / no dep on vacuum

This commit is contained in:
NatureFreshMilk
2019-12-10 15:05:37 +01:00
parent a3fcba69c3
commit 379d07a8fc
7 changed files with 42 additions and 38 deletions
+17
View File
@@ -0,0 +1,17 @@
name: luacheck
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./
+22
View File
@@ -0,0 +1,22 @@
unused_args = false
allow_defined_top = true
globals = {
"spacesuit",
}
read_globals = {
-- Stdlib
string = {fields = {"split"}},
table = {fields = {"copy", "getn"}},
"call",
-- Minetest
"minetest",
"vector", "ItemStack",
"dump", "VoxelArea",
-- Deps
"unified_inventory", "default", "monitoring",
"armor"
}
-1
View File
@@ -1,3 +1,2 @@
default default
3d_armor 3d_armor
vacuum?
+1 -3
View File
@@ -8,9 +8,7 @@ minetest.register_globalstep(function(dtime)
local t0 = minetest.get_us_time() local t0 = minetest.get_us_time()
for _,player in ipairs(minetest.get_connected_players()) do for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name() local _, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
local name, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]")
local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet") local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet")
local has_chestplate = armor_inv:contains_item("armor", "spacesuit:chestplate") local has_chestplate = armor_inv:contains_item("armor", "spacesuit:chestplate")
-5
View File
@@ -161,9 +161,6 @@ spacesuit.set_player_wearing = function(player, has_full_suit, has_helmet, armor
-- player wears it -- player wears it
update_hud(player, has_full_suit, armor_list) update_hud(player, has_full_suit, armor_list)
elseif not hud_data and not has_helmet then
-- player does not wear it
elseif hud_data and not has_helmet then elseif hud_data and not has_helmet then
-- player stopped wearing -- player stopped wearing
remove_hud(player) remove_hud(player)
@@ -177,5 +174,3 @@ spacesuit.set_player_wearing = function(player, has_full_suit, has_helmet, armor
end end
end end
+1 -2
View File
@@ -1,11 +1,10 @@
# Intro # Intro
Spacesuit for minetest Spacesuit mod for minetest
# Dependencies # Dependencies
* 3d_armor * 3d_armor
* vacuum?
# Features # Features
* Breathe in vacuum or water * Breathe in vacuum or water
-26
View File
@@ -1,26 +0,0 @@
local has_vacuum = minetest.get_modpath("vacuum")
if has_vacuum then
function repair_recipe(partname)
minetest.register_craft({
type = "shapeless",
output = partname,
recipe = {
"vacuum:air_bottle",
partname
},
replacements = {
{"vacuum:air_bottle", "vessels:steel_bottle"}
}
})
end
repair_recipe("spacesuit:helmet")
repair_recipe("spacesuit:chestplate")
repair_recipe("spacesuit:pants")
repair_recipe("spacesuit:boots")
end