Resolve luacheck findings

This commit is contained in:
teknomunk 2024-09-29 06:38:41 -05:00
parent e53bb82a3c
commit 64dc0e6277
3 changed files with 4 additions and 5 deletions

@ -1,6 +1,6 @@
name = mcl_bows name = mcl_bows
author = Arcelmi author = Arcelmi
description = This mod adds bows and arrows for MineClone 2. 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 optional_depends = awards, mcl_achievements, mcl_core, mcl_mobitems, playerphysics, doc, doc_identifier, mesecons_button

@ -230,7 +230,7 @@ minetest.register_craftitem("mcl_bows:rocket", {
local yaw = math.atan2(dropdir.z, dropdir.x) + YAW_OFFSET local yaw = math.atan2(dropdir.z, dropdir.x) + YAW_OFFSET
mcl_bows.shoot_arrow(itemstack:get_name(), shootpos, dropdir, yaw, nil, 19, 3) mcl_bows.shoot_arrow(itemstack:get_name(), shootpos, dropdir, yaw, nil, 19, 3)
end, end,
_on_collide_with_entity = function(self, pos, obj) _on_collide_with_entity = function(self, _, obj)
if self._in_player == false then if self._in_player == false then
pos = self.object:get_pos() pos = self.object:get_pos()
obj:punch(self.object, 1.0, { obj:punch(self.object, 1.0, {

@ -1,5 +1,5 @@
local mod = {} vl_projectile = {}
vl_projectile = mod local mod = vl_projectile
local vl_physics_path = minetest.get_modpath("vl_physics") 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 function handle_entity_collision(self, entity_def, projectile_def, object)
local pos = self.object:get_pos() local pos = self.object:get_pos()
local dir = vector.normalize(self.object:get_velocity()) local dir = vector.normalize(self.object:get_velocity())
local self_vl_projectile = self._vl_projectile
-- Check if this is allowed -- Check if this is allowed
local allow_punching = projectile_def.allow_punching or true local allow_punching = projectile_def.allow_punching or true