diff --git a/quant.ew/files/system/enemy_sync.lua b/quant.ew/files/system/enemy_sync.lua index 45818103..870ebeef 100644 --- a/quant.ew/files/system/enemy_sync.lua +++ b/quant.ew/files/system/enemy_sync.lua @@ -644,6 +644,9 @@ local function sync_enemy(enemy_info_raw, force_no_cull) local found = false for _, child in ipairs(EntityGetAllChildren(enemy_id) or {}) do if EntityGetName(child) == "inventory_quick" then + if EntityGetParent(wand) ~= nil then + EntityRemoveFromParent(wand) + end EntityAddChild(child, wand) found = true break diff --git a/quant.ew/files/system/item_sync.lua b/quant.ew/files/system/item_sync.lua index 451bb8b3..b62b3ed6 100644 --- a/quant.ew/files/system/item_sync.lua +++ b/quant.ew/files/system/item_sync.lua @@ -268,7 +268,10 @@ function item_sync.on_world_update() if GameGetFrameNum() % 5 == 2 then for _, ent in ipairs(EntityGetWithTag("mimic_potion")) do if EntityHasTag(ent, "polymorphed_player") then - EntityRemoveComponent(ent, EntityGetFirstComponentIncludingDisabled(ent, "ItemComponent")) + local com = EntityGetFirstComponentIncludingDisabled(ent, "ItemComponent") + if com ~= nil then + EntityRemoveComponent(ent, com) + end elseif ctx.is_host then if not EntityHasTag(ent, "ew_global_item") then item_sync.make_item_global(ent)