View Issue Details

IDProjectCategoryView StatusLast Update
0006026Dwarf FortressDwarf Mode -- Jobs, Smeltingpublic2015-03-03 17:32
ReporterQuietust Assigned Touser6 
PrioritynormalSeverityminorReproducibilityhave not tried
Status confirmedResolutionopen 
Product Version0.34.11 
Summary0006026: Melting coins creates too much metal
DescriptionMinting a stack of 500 coins costs 1 bar of metal. Melting that stack down at a smelter, however, yields 1.1 bars - melting 10 stacks of coins nets 11 bars.

This seems to be due to a rounding error - the code takes the item's stack size, divides it by 50, then adds 1, meaning a stack of 500 coins yields 11/10 bars when melted.
Steps To Reproduce1. Mint 10 stacks of coins, using 10 bars of metal
2. Melt down those 10 stacks of coins at a smelter
3. Observe that the smelter now contains 11 bars of metal
Additional InformationI originally discovered this while annotating a disassembly of version 0.23.130.23a, so this bug dates back quite a long time.
TagsNo tags attached.

Relationships

related to 0008339 resolveduser1294 Bar-melting exploit no longer seems to work. 
related to 0006027 confirmeduser6 Melting weapons/armor/etc. yields too much metal 

Activities

Quietust

2012-06-15 08:53

reporter   ~0023015

The simplest solution to this problem would be to subtract 1 from the stack size before performing the division - since an item can never have a stack size of zero, this should work as intended.

This problem technically also exists with ammo (99 bolts would give 1 bar, 100 bolts would give 1.1 bars), but it's not an issue since forging metal bolts only gives you a stack of 25.

Quietust

2012-06-15 13:51

reporter   ~0023021

Last edited: 2012-06-22 17:14

There are several other item types which melt down to yield exactly the same amount of metal that was needed to make them: chains, instruments, animal traps, and buckets. Interestingly, buckets have had a 1 bar melt yield ever since 0.23.130.23a (and possibly earlier), while the others only yielded 0.5 bars prior to 0.34.06.

Quietust

2014-09-15 17:33

reporter   ~0030206

Confirmed still present in 0.40.12

jwoodward48df

2015-03-03 07:35

reporter   ~0032316

This problem does exist with bolts.

Quietust

2015-03-03 17:32

reporter   ~0032320

jwoodward48df: just like I said in my original comment above...

Add Note

Note

Issue History

Date Modified Username Field Change
2012-06-15 08:51 Quietust New Issue
2012-06-15 08:53 Quietust Note Added: 0023015
2012-06-15 13:51 Quietust Note Added: 0023021
2012-06-15 13:52 user6 Relationship added related to 0006027
2012-06-16 08:01 Quietust Note Edited: 0023021
2012-06-22 17:14 Quietust Note Edited: 0023021
2014-09-15 17:33 Quietust Note Added: 0030206
2014-09-15 17:50 user6 Assigned To => user6
2014-09-15 17:50 user6 Status new => confirmed
2014-09-23 19:16 user6 Relationship added related to 0008339
2015-03-03 07:35 jwoodward48df Note Added: 0032316
2015-03-03 17:32 Quietust Note Added: 0032320