From 86651e7557d0f076bb2c91a8c00ef6543713dc34 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 26 Jun 2022 00:39:31 +0200 Subject: [PATCH 1/2] Fix zombie villager curing (crash) --- mods/ENTITIES/mobs_mc/villager_zombie.lua | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/villager_zombie.lua b/mods/ENTITIES/mobs_mc/villager_zombie.lua index 3dece8c29c..daeed9e9a3 100644 --- a/mods/ENTITIES/mobs_mc/villager_zombie.lua +++ b/mods/ENTITIES/mobs_mc/villager_zombie.lua @@ -119,20 +119,7 @@ mcl_mobs:register_mob("mobs_mc:villager_zombie", { villager_obj:set_yaw(yaw) villager.target_yaw = yaw villager.nametag = self.nametag - local texture = self.base_texture[1]:gsub("zombie", "villager") - if texture == "mobs_mc_villager_villager.png" then - texture = "mobs_mc_villager.png" - end - local textures = {texture} - villager.base_texture = textures - villager_obj:set_properties({textures = textures}) - local matches = {} - for prof, tex in pairs(professions) do - if texture == tex then - table.insert(matches, prof) - end - end - villager._profession = matches[math.random(#matches)] + villager._profession = "unemployed" self._curing = nil mcl_burning.extinguish(obj) obj:remove() From d9e40d52235bf6dc0e9a69ae4c9e14ccaeca3af7 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 26 Jun 2022 11:19:21 +0200 Subject: [PATCH 2/2] set profession first in on_spawn --- mods/ENTITIES/mobs_mc/villager.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index 1d62082c99..1c2cffb9b2 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1362,17 +1362,17 @@ mcl_mobs:register_mob("mobs_mc:villager", { end, on_spawn = function(self) - if self._id then - set_textures(self) - return - end - self._id=minetest.sha1(minetest.get_gametime()..minetest.pos_to_string(self.object:get_pos())..tostring(math.random())) if not self._profession then self._profession = "unemployed" if math.random(100) == 1 then self._profession = "nitwit" end end + if self._id then + set_textures(self) + return + end + self._id=minetest.sha1(minetest.get_gametime()..minetest.pos_to_string(self.object:get_pos())..tostring(math.random())) set_textures(self) end, on_die = function(self, pos)