Bug: Equipment crafting cancellation gives flat 50% refund regardless of progress #216
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 equipment crafting, the player receives a flat 50% refund of the total mana cost, regardless of how much progress has been made. This means cancelling at 99% completion still refunds 50% of the full cost.
Code Location
src/lib/game/crafting-equipment.tslines 125-130:cancelEquipmentCraftingusesmanaSpent(total recipe cost) for the refund calculationsrc/lib/game/stores/craftingStore.tslines 208-215:cancelEquipmentCraftingaction passesprogress.manaSpent(total cost, not remaining)Impact
Players can exploit this by:
Fix Required
The refund should be proportional to remaining progress:
Or alternatively, track
manaAlreadySpentseparately frommanaRemainingand refund based on remaining.Fixed: Equipment crafting cancellation now refunds proportionally to remaining progress instead of a flat 50%. Also added material refund on cancellation in craftingStore.ts. The refund rate is: full refund for unspent progress + 50% for spent progress.