diff --git a/quant.ew/files/system/nickname.lua b/quant.ew/files/system/nickname.lua index 20fee27e..8ddc748b 100644 --- a/quant.ew/files/system/nickname.lua +++ b/quant.ew/files/system/nickname.lua @@ -73,7 +73,9 @@ function nickname.calculate_textwidth(text, font) end function nickname.add_label(player_entity, text, font_filename, scale, alpha) - if not EntityGetIsAlive(player_entity) or EntityHasTag(player_entity, "polymorphed_cessation") then + if not EntityGetIsAlive(player_entity) + or EntityHasTag(player_entity, "polymorphed_cessation") + or EntityHasTag(player_entity, "polymorphed_player") then return end local prev_nickname = EntityGetFirstComponentIncludingDisabled(player_entity, "SpriteComponent", "ew_nickname") diff --git a/quant.ew/files/system/polymorph/polymorph.lua b/quant.ew/files/system/polymorph/polymorph.lua index 245746f5..56c4a279 100644 --- a/quant.ew/files/system/polymorph/polymorph.lua +++ b/quant.ew/files/system/polymorph/polymorph.lua @@ -89,7 +89,7 @@ end function module.on_world_update_post() local ent = np.GetPlayerEntity() if ent ~= nil and ent ~= ctx.my_player.entity then - if EntityHasTag(ent, "mimic_potion") then + if EntityGetFirstComponentIncludingDisabled(ent, "ItemComponent") ~= nil then local effect for _, child in ipairs(EntityGetAllChildren(ent) or {}) do local com = EntityGetFirstComponentIncludingDisabled(child, "GameEffectComponent") @@ -108,9 +108,12 @@ function module.on_world_update_post() ComponentSetValue2(effect, "frames", 1200) end end - local item = EntityGetFirstComponentIncludingDisabled(ent, "ItemComponent") - ComponentRemoveTag(item, "enabled_if_charmed") - EntitySetComponentIsEnabled(ent, item, true) + + if EntityHasTag(ent, "mimic_potion") then + local item = EntityGetFirstComponentIncludingDisabled(ent, "ItemComponent") + ComponentRemoveTag(item, "enabled_if_charmed") + EntitySetComponentIsEnabled(ent, item, true) + end EntityAddComponent2(ent, "LuaComponent", { script_item_picked_up = "mods/quant.ew/files/system/potion_mimic/pickup.lua", diff --git a/quant.ew/files/system/potion_mimic/potion_mimic.lua b/quant.ew/files/system/potion_mimic/potion_mimic.lua index 16d4ac8a..bfb33f3f 100644 --- a/quant.ew/files/system/potion_mimic/potion_mimic.lua +++ b/quant.ew/files/system/potion_mimic/potion_mimic.lua @@ -2,11 +2,9 @@ local rpc = net.new_rpc_namespace() local potion = {} function potion.enable_in_world(item) - for _, com in ipairs(EntityGetAllComponents(item) or {}) do - EntitySetComponentIsEnabled(item, com, true) - end - EntitySetComponentIsEnabled(item, EntityGetFirstComponentIncludingDisabled(item, "SpriteComponent", "enabled_in_hand"), false) - EntitySetComponentIsEnabled(item, EntityGetFirstComponentIncludingDisabled(item, "ItemChestComponent"), false) + EntitySetComponentsWithTagEnabled(item, "enabled_in_hand", false) + EntitySetComponentsWithTagEnabled(item, "enabled_in_inventory", false) + EntitySetComponentsWithTagEnabled(item, "enabled_in_world", true) if EntityGetParent(item) ~= 0 then EntityRemoveFromParent(item) end @@ -57,7 +55,7 @@ function rpc.ensure_held(peer_id) end function potion.on_world_update() - if EntityHasTag(ctx.my_player.entity, "mimic_potion") then + if EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ItemComponent") ~= nil then local effect for _, child in ipairs(EntityGetAllChildren(ctx.my_player.entity) or {}) do local com = EntityGetFirstComponentIncludingDisabled(child, "GameEffectComponent")