diff --git a/quant.ew/files/core/inventory_helper.lua b/quant.ew/files/core/inventory_helper.lua index e446fb62..8e86a8a4 100644 --- a/quant.ew/files/core/inventory_helper.lua +++ b/quant.ew/files/core/inventory_helper.lua @@ -352,7 +352,7 @@ local function remove_non_send(item) end end -function inventory_helper.set_item_data(item_data, player_data) +function inventory_helper.set_item_data(item_data, player_data, local_ent) local player = player_data.entity if player == nil or not EntityGetIsAlive(player) then return @@ -416,9 +416,11 @@ function inventory_helper.set_item_data(item_data, player_data) if (itemInfo.active) then active_item_entity = item_entity end - EntityAddComponent(item_entity, "LuaComponent", { - script_throw_item = "mods/quant.ew/files/resource/cbs/throw_item.lua", - }) + if not local_ent then + EntityAddComponent(item_entity, "LuaComponent", { + script_throw_item = "mods/quant.ew/files/resource/cbs/throw_item.lua", + }) + end local notify = EntityGetFirstComponentIncludingDisabled(item_entity, "LuaComponent", "ew_notify_component") if notify ~= nil then EntityRemoveComponent(item_entity, notify) diff --git a/quant.ew/files/system/local_health/local_health.lua b/quant.ew/files/system/local_health/local_health.lua index df5573db..fea0b0b5 100644 --- a/quant.ew/files/system/local_health/local_health.lua +++ b/quant.ew/files/system/local_health/local_health.lua @@ -280,7 +280,7 @@ local function player_died() EntitySetComponentIsEnabled(child, EntityGetFirstComponentIncludingDisabled(child, "SpriteComponent"), false) end end - inventory_helper.set_item_data(item_data, ctx.my_player) + inventory_helper.set_item_data(item_data, ctx.my_player, true) remove_inventory_tags() perk_fns.update_perks_for_entity(perk_data, ctx.my_player.entity, allow_notplayer_perk) util.set_ent_health(ctx.my_player.entity, {max_hp, max_hp}) @@ -471,7 +471,7 @@ ctx.cap.health = { ComponentSetValue2(damage_model, "mFireFramesLeft", 0) ComponentSetValue2(damage_model, "air_in_lungs", ComponentGetValue2(damage_model, "air_in_lungs_max")) end - inventory_helper.set_item_data(item_data, ctx.my_player) + inventory_helper.set_item_data(item_data, ctx.my_player, true) remove_inventory_tags() local controls = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "ControlsComponent") if controls ~= nil then