mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-08-20 14:04:10 +02:00
Object reference check before setting velocity
This commit is contained in:
parent
df8592df41
commit
cc5a0971ac
@ -125,8 +125,8 @@ mcl_mobs.register_mob("mobs_mc:sheep", {
|
||||
self:set_animation("eat")
|
||||
self:set_velocity(0)
|
||||
minetest.after(self.replace_delay, function()
|
||||
self.object:set_velocity(vector.zero())
|
||||
if self and self.object and self.object:get_velocity() and self.health > 0 then
|
||||
self.object:set_velocity(vector.zero())
|
||||
if not self.color or not colors[self.color] then
|
||||
self.color = "unicolor_white"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user