Bug: Crafting cancellation never refunds resources (mana + materials) #221
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
When cancelling any form of crafting (equipment crafting, enchantment application, enchantment preparation, or fabricator crafting), none of the invested resources are refunded. The cancel handlers only log a message and set progress to null.
Additionally, for fabricator recipes, the blueprint lookup fails because it searches
CRAFTING_RECIPESwith the fullfabricator-xxxprefix, which doesn't exist there, so even the broken refund path returns "Invalid crafting recipe."Code Locations
craftingStore.tslines 208-215): CallsCraftingEquipment.cancelEquipmentCrafting()which only returns 50% of raw mana spent. Never refunds materials.crafting-apply.tslines 163-165): Just sets progress to null. No mana refund despite trackingmanaSpent.crafting-prep.tslines 96-98): Just sets progress to null. No mana refund despite trackingmanaCostPaid.The
refundFabricatorManafunction exists incrafting-fabricator.tsbut is never called anywhere — it's dead code.Impact
High. Players permanently lose all mana and materials invested in any crafting that gets cancelled. This is especially punishing for:
Fix Required
All three cancel paths need resource refunds:
manaSpentmanaCostPaidrefundFabricatorManafunctionFixed: Cancel handlers for application, preparation, and fabricator crafting now refund mana proportionally to remaining progress.