Skip to content

Commit 80ef2a0

Browse files
committed
fix: sound playing on first hover
Certain items (like mandrake) have an `oncooked` function that plays a little sound. This would be executed the first time you hovered it in the inventory.
1 parent 6c19cd9 commit 80ef2a0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modinfo.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Item Meta"
22
description = "Displays extra metadata in item tooltips."
33
author = "gimmeh"
4-
version = "0.3.0"
4+
version = "0.3.1"
55
forumthread = ""
66
api_version = 10
77
api_version_dst = 10

scripts/itemmeta/itemmeta/ItemMeta_factory.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ local function SpawnAndRemoveItem(prefab)
2424
if itemCopy.components and itemCopy.components.cookable then
2525
local campfire = debug.safecall(SpawnPrefab, "campfire")
2626
debug.safecall(function()
27+
itemCopy.components.cookable:SetOnCookedFn(nil)
2728
itemCopyCooked = itemCopy.components.cookable:Cook(campfire, ThePlayer)
2829
itemCopyCooked:Remove()
2930
end)

0 commit comments

Comments
 (0)