From bd4a701322b23d9164329c6a093d5139a1c989be Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sun, 29 Sep 2024 06:38:41 -0500 Subject: [PATCH] Resolve luacheck findings --- mods/ITEMS/mcl_bows/mod.conf | 2 +- mods/ITEMS/mcl_bows/rocket.lua | 2 +- mods/ITEMS/vl_projectile/init.lua | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/mcl_bows/mod.conf b/mods/ITEMS/mcl_bows/mod.conf index 911929156..bd73d23f7 100644 --- a/mods/ITEMS/mcl_bows/mod.conf +++ b/mods/ITEMS/mcl_bows/mod.conf @@ -1,6 +1,6 @@ name = mcl_bows author = Arcelmi description = This mod adds bows and arrows for MineClone 2. -depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields, mcl_fovapi, mcl_luck, vl_projectile +depends = controls, mcl_particles, mcl_enchanting, mcl_init, mcl_util, mcl_shields, mcl_fovapi, mcl_luck, vl_projectile, mcl_explosions optional_depends = awards, mcl_achievements, mcl_core, mcl_mobitems, playerphysics, doc, doc_identifier, mesecons_button diff --git a/mods/ITEMS/mcl_bows/rocket.lua b/mods/ITEMS/mcl_bows/rocket.lua index bff190ec8..2ed61bf85 100644 --- a/mods/ITEMS/mcl_bows/rocket.lua +++ b/mods/ITEMS/mcl_bows/rocket.lua @@ -230,7 +230,7 @@ minetest.register_craftitem("mcl_bows:rocket", { local yaw = math.atan2(dropdir.z, dropdir.x) + YAW_OFFSET mcl_bows.shoot_arrow(itemstack:get_name(), shootpos, dropdir, yaw, nil, 19, 3) end, - _on_collide_with_entity = function(self, pos, obj) + _on_collide_with_entity = function(self, _, obj) if self._in_player == false then pos = self.object:get_pos() obj:punch(self.object, 1.0, { diff --git a/mods/ITEMS/vl_projectile/init.lua b/mods/ITEMS/vl_projectile/init.lua index 3174c192b..8b85a9895 100644 --- a/mods/ITEMS/vl_projectile/init.lua +++ b/mods/ITEMS/vl_projectile/init.lua @@ -1,5 +1,5 @@ -local mod = {} -vl_projectile = mod +vl_projectile = {} +local mod = vl_projectile local vl_physics_path = minetest.get_modpath("vl_physics") @@ -256,7 +256,6 @@ end local function handle_entity_collision(self, entity_def, projectile_def, object) local pos = self.object:get_pos() local dir = vector.normalize(self.object:get_velocity()) - local self_vl_projectile = self._vl_projectile -- Check if this is allowed local allow_punching = projectile_def.allow_punching or true