diff --git a/fs_fashion.lua b/fs_fashion.lua index 437f170..9c75e40 100644 --- a/fs_fashion.lua +++ b/fs_fashion.lua @@ -507,7 +507,10 @@ yl_speak_up.get_fs_fashion = function(pname) local skins = yl_speak_up.mob_skins[mob_type] local textures = yl_speak_up.speak_to[pname].textures - local skin = (textures[texture_index] or "") + local skin = "" + if(textures and textures[texture_index]) then + skin = (textures[texture_index] or "") + end -- store the old texture so that we can go back to it local old_texture = yl_speak_up.speak_to[pname].old_texture if(not(old_texture)) then diff --git a/fs_npc_list.lua b/fs_npc_list.lua index bcb2eb0..5de8654 100644 --- a/fs_npc_list.lua +++ b/fs_npc_list.lua @@ -86,6 +86,7 @@ yl_speak_up.update_npc_data = function(self, dialog, force_store) muted = self.yl_speak_up.talk, animation = self.yl_speak_up.animation, skin = self.yl_speak_up.skin, + textures = self.textures, } -- the current object will change after deactivate; there is no point in storing -- it over server restart @@ -238,6 +239,7 @@ yl_speak_up.command_npc_force_restore_npc = function(pname, rest) npc_description = npc_desc, infotext = yl_speak_up.infotext, -- will be set automaticly later animation = data.animation, + textures = data.textures, } -- This is at least useful for mobs_redo. Other mob mods may require adjustments. ent.owner = npc_owner @@ -249,6 +251,7 @@ yl_speak_up.command_npc_force_restore_npc = function(pname, rest) end if(data.skin and ent.object) then ent.object:set_properties({textures = table.copy(data.skin)}) + ent.yl_speak_up.textures = table.copy(data.skin) end -- update the NPC list yl_speak_up.update_npc_data(ent, dialog, true)