From 2b691dea075f623ce1d7faa731ca626f2c0a262a Mon Sep 17 00:00:00 2001 From: cora Date: Fri, 11 Nov 2022 17:28:45 +0100 Subject: [PATCH] Fix some more global var warnings --- mods/ENTITIES/mcl_mobs/combat.lua | 1 - mods/ENTITIES/mcl_mobs/init.lua | 1 - mods/ENTITIES/mcl_mobs/movement.lua | 2 ++ mods/ENTITIES/mcl_mobs/physics.lua | 1 + mods/ENTITIES/mcl_mobs/spawning.lua | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/combat.lua b/mods/ENTITIES/mcl_mobs/combat.lua index ee46c3e34..37ba3186e 100644 --- a/mods/ENTITIES/mcl_mobs/combat.lua +++ b/mods/ENTITIES/mcl_mobs/combat.lua @@ -4,7 +4,6 @@ local mob_class = mcl_mobs.mob_class local damage_enabled = minetest.settings:get_bool("enable_damage") local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false -local show_health = false -- pathfinding settings local stuck_timeout = 3 -- how long before mob gets stuck in place and starts searching local stuck_path_timeout = 10 -- how long will mob follow path before giving up diff --git a/mods/ENTITIES/mcl_mobs/init.lua b/mods/ENTITIES/mcl_mobs/init.lua index 5b8ef275b..21cad4655 100644 --- a/mods/ENTITIES/mcl_mobs/init.lua +++ b/mods/ENTITIES/mcl_mobs/init.lua @@ -297,7 +297,6 @@ minetest.register_entity(name, setmetatable({ on_breed = def.on_breed, on_grown = def.on_grown, on_pick_up = def.on_pick_up, - on_detach_child = mob_detach_child, on_activate = function(self, staticdata, dtime) --this is a temporary hack so mobs stop --glitching and acting really weird with the diff --git a/mods/ENTITIES/mcl_mobs/movement.lua b/mods/ENTITIES/mcl_mobs/movement.lua index d8ace59fd..eedf65b29 100644 --- a/mods/ENTITIES/mcl_mobs/movement.lua +++ b/mods/ENTITIES/mcl_mobs/movement.lua @@ -4,6 +4,8 @@ local DEFAULT_FALL_SPEED = -9.81*1.5 local FLOP_HEIGHT = 6 local FLOP_HOR_SPEED = 1.5 local PATHFINDING = "gowp" +local enable_pathfinding = true + local node_ice = "mcl_core:ice" local node_snowblock = "mcl_core:snowblock" local node_snow = "mcl_core:snow" diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index 46bdd878b..bbeffd710 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -11,6 +11,7 @@ local PATHFINDING = "gowp" local mobs_debug = minetest.settings:get_bool("mobs_debug", false) local mobs_drop_items = minetest.settings:get_bool("mobs_drop_items") ~= false local mob_active_range = tonumber(minetest.settings:get("mcl_mob_active_range")) or 48 +local show_health = false -- get node but use fallback for nil or unknown local node_ok = function(pos, fallback) diff --git a/mods/ENTITIES/mcl_mobs/spawning.lua b/mods/ENTITIES/mcl_mobs/spawning.lua index a3cdbb30d..35892c100 100644 --- a/mods/ENTITIES/mcl_mobs/spawning.lua +++ b/mods/ENTITIES/mcl_mobs/spawning.lua @@ -733,7 +733,7 @@ function mob_class:check_despawn(pos) and self.state ~= "attack" and self.following == nil then if self.despawn_immediately or self.lifetimer <= 0 then - if spawn_logging then + if logging then minetest.log("action", "[mcl_mobs] Mob "..self.name.." despawns at "..minetest.pos_to_string(pos, 1) .. " lifetimer ran out") end mcl_burning.extinguish(self.object)