1
0
Fork 0

entity cramming: check less often

This commit is contained in:
cora 2022-05-21 21:36:38 +02:00
parent b4cbc528a3
commit 85b599edba
1 changed files with 2 additions and 4 deletions

View File

@ -2982,10 +2982,9 @@ local function check_entity_cramming(self)
local l = o:get_luaentity() local l = o:get_luaentity()
if l and clear then if l and clear then
l.cram = nil l.cram = nil
ncram = {}
elseif l and l.cram == nil then elseif l and l.cram == nil then
table.insert(ncram,l) table.insert(ncram,l)
elseif l and l.cram then elseif not clear and l and l.cram then
damage_mob(l,"cramming",cramming_damage) damage_mob(l,"cramming",cramming_damage)
end end
end end
@ -3570,7 +3569,6 @@ end
-- main mob function -- main mob function
local mob_step = function(self, dtime) local mob_step = function(self, dtime)
check_item_pickup(self) check_item_pickup(self)
check_entity_cramming(self)
if not self.fire_resistant then if not self.fire_resistant then
mcl_burning.tick(self.object, dtime, self) mcl_burning.tick(self.object, dtime, self)
end end
@ -3684,7 +3682,7 @@ local mob_step = function(self, dtime)
if (self.state == "attack" and self.env_damage_timer > 1) if (self.state == "attack" and self.env_damage_timer > 1)
or self.state ~= "attack" then or self.state ~= "attack" then
check_entity_cramming(self)
self.env_damage_timer = 0 self.env_damage_timer = 0
-- check for environmental damage (water, fire, lava etc.) -- check for environmental damage (water, fire, lava etc.)