From 69c64a2c246d0b6207d4d4c8ba8ebb07cf53f17d Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 27 Nov 2022 21:14:19 +0100 Subject: [PATCH] Fix wrong self ref with mcl_mobs.spawn_child --- mods/ENTITIES/mobs_mc/horse.lua | 2 +- mods/ENTITIES/mobs_mc/llama.lua | 2 +- mods/ENTITIES/mobs_mc/pig.lua | 2 +- mods/ENTITIES/mobs_mc/sheep.lua | 2 +- mods/ITEMS/mcl_throwing/register.lua | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/horse.lua b/mods/ENTITIES/mobs_mc/horse.lua index a69234b445..7f61627bc9 100644 --- a/mods/ENTITIES/mobs_mc/horse.lua +++ b/mods/ENTITIES/mobs_mc/horse.lua @@ -441,7 +441,7 @@ local horse = { on_breed = function(parent1, parent2) local pos = parent1.object:get_pos() - local child = mcl_mobs:spawn_child(pos, parent1.name) + local child = mcl_mobs.spawn_child(pos, parent1.name) if child then local ent_c = child:get_luaentity() local p = math.random(1, 2) diff --git a/mods/ENTITIES/mobs_mc/llama.lua b/mods/ENTITIES/mobs_mc/llama.lua index 1f458ec892..503f4207ba 100644 --- a/mods/ENTITIES/mobs_mc/llama.lua +++ b/mods/ENTITIES/mobs_mc/llama.lua @@ -221,7 +221,7 @@ mcl_mobs.register_mob("mobs_mc:llama", { else parent = parent2 end - child = mcl_mobs:spawn_child(pos, parent.name) + child = mcl_mobs.spawn_child(pos, parent.name) if child then local ent_c = child:get_luaentity() ent_c.base_texture = table.copy(ent_c.base_texture) diff --git a/mods/ENTITIES/mobs_mc/pig.lua b/mods/ENTITIES/mobs_mc/pig.lua index 3fb2d2edbc..99e05391fc 100644 --- a/mods/ENTITIES/mobs_mc/pig.lua +++ b/mods/ENTITIES/mobs_mc/pig.lua @@ -186,7 +186,7 @@ mcl_mobs.register_mob("mobs_mc:pig", { on_breed = function(parent1, parent2) local pos = parent1.object:get_pos() - local child = mcl_mobs:spawn_child(pos, parent1.name) + local child = mcl_mobs.spawn_child(pos, parent1.name) if child then local ent_c = child:get_luaentity() ent_c.tamed = true diff --git a/mods/ENTITIES/mobs_mc/sheep.lua b/mods/ENTITIES/mobs_mc/sheep.lua index 4f3d3a048d..caa22205b3 100644 --- a/mods/ENTITIES/mobs_mc/sheep.lua +++ b/mods/ENTITIES/mobs_mc/sheep.lua @@ -267,7 +267,7 @@ mcl_mobs.register_mob("mobs_mc:sheep", { on_breed = function(parent1, parent2) -- Breed sheep and choose a fur color for the child. local pos = parent1.object:get_pos() - local child = mcl_mobs:spawn_child(pos, parent1.name) + local child = mcl_mobs.spawn_child(pos, parent1.name) if child then local ent_c = child:get_luaentity() local color1 = parent1.color diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 9626be6268..43dedd33b7 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -141,7 +141,7 @@ local function egg_on_step(self, dtime) local r = math.random(1,8) if r == 1 then - mcl_mobs:spawn_child(self._lastpos, "mobs_mc:chicken") + mcl_mobs.spawn_child(self._lastpos, "mobs_mc:chicken") -- BONUS ROUND: 1/32 chance to spawn 3 additional chicks local r = math.random(1,32) @@ -153,7 +153,7 @@ local function egg_on_step(self, dtime) } for o=1, 3 do local pos = vector.add(self._lastpos, offsets[o]) - mcl_mobs:spawn_child(pos, "mobs_mc:chicken") + mcl_mobs.spawn_child(pos, "mobs_mc:chicken") end end end