From 0cbaf3c86a1e893b2d34bbb938ba5d844b0b3773 Mon Sep 17 00:00:00 2001 From: bgkillas Date: Sun, 3 Nov 2024 19:16:38 -0500 Subject: [PATCH] fix some log errors --- quant.ew/files/system/enemy_sync.lua | 3 +++ quant.ew/files/system/item_sync.lua | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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)