From ae169b2814e1746ef81f5f6bb0d1abbd6b6598ed Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Fri, 15 Dec 2023 03:09:48 +0000 Subject: [PATCH] Add fix to crash when moving bought villager trade item to empty sell slot bug by JoseDouglas26 (#4079) Add fix to #4062 by JoseDouglas26 https://git.minetest.land/MineClone2/MineClone2/issues/4062#issuecomment-74045 Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4079 Reviewed-by: the-real-herowl Co-authored-by: Eliy21 Co-committed-by: Eliy21 --- mods/ENTITIES/mobs_mc/villager.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mobs_mc/villager.lua b/mods/ENTITIES/mobs_mc/villager.lua index cb421b78b..9f1daf53d 100644 --- a/mods/ENTITIES/mobs_mc/villager.lua +++ b/mods/ENTITIES/mobs_mc/villager.lua @@ -1941,6 +1941,7 @@ local trade_inventory = { if not wanted2:is_empty() then inv:remove_item("input", inv:get_stack("wanted", 2)) end + local name = player:get_player_name() local trader = player_trading_with[name] minetest.sound_play("mobs_mc_villager_accept", {to_player = player:get_player_name(),object=trader.object}, true) end