fix crash in mcl_mobs

This commit is contained in:
chmodsayshello 2022-05-29 19:39:36 +00:00
parent a6a4c675d1
commit d4ad108bdd
1 changed files with 3 additions and 3 deletions

View File

@ -2958,7 +2958,7 @@ local function check_item_pickup(self)
end
end
local function damage_mob(self,reason,damage)
local function damage_mob(self,reason,damage,pos)
if not self.health then return end
damage = floor(damage)
if damage > 0 then
@ -2989,7 +2989,7 @@ 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,p)
end
end
end
@ -3079,7 +3079,7 @@ local falling = function(self, pos)
if add ~= 0 then
damage = damage + damage * (add/100)
end
damage_mob(self,"fall",damage)
damage_mob(self,"fall",damage,pos)
end
self.old_y = self.object:get_pos().y