From af7dc0fb8f9643e21693ade92abe8b8b61aa5d2e Mon Sep 17 00:00:00 2001 From: cora Date: Tue, 24 May 2022 13:43:55 +0200 Subject: [PATCH] change "constant" declaration to match mcl_mobs --- mods/ENTITIES/mcl_mobs/api.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index 959c59ff1..645eea86e 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -11,6 +11,8 @@ local DEATH_DELAY = 0.5 local DEFAULT_FALL_SPEED = -10 local FLOP_HEIGHT = 5.0 local FLOP_HOR_SPEED = 1.5 +local ENTITY_CRAMMING_MAX = 24 +local CRAMMING_DAMAGE = 3 local MOB_CAP = {} MOB_CAP.hostile = 70 @@ -2970,12 +2972,10 @@ local function damage_mob(self,reason,damage) end end -local entity_cramming_max = 24 -local cramming_damage = 3 local function check_entity_cramming(self) local p = self.object:get_pos() local oo = minetest.get_objects_inside_radius(p,1) - local clear = #oo < entity_cramming_max + local clear = #oo < ENTITY_CRAMMING_MAX local ncram = {} for _,o in pairs(oo) do local l = o:get_luaentity() @@ -2985,12 +2985,12 @@ local function check_entity_cramming(self) elseif l.cram == nil and not self.child then table.insert(ncram,l) elseif l.cram then - damage_mob(l,"cramming",cramming_damage) + damage_mob(l,"cramming",CRAMMING_DAMAGE) end end end for i,l in pairs(ncram) do - if i > entity_cramming_max then + if i > ENTITY_CRAMMING_MAX then l.cram = true else l.cram = nil