|Anonymous | Login | Signup for a new account||2022-07-03 01:08 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005739||Dwarf Fortress||Dwarf Mode -- Stockpiles||public||2012-03-31 18:39||2014-07-23 10:40|
|Assigned To||Toady One|
|Platform||Windows||OS||Vista||OS Version||Windows Vista|
|Target Version||Fixed in Version||0.40.01|
|Summary||0005739: Stockpile settings for cloth are broken if adamantine cloth is permitted|
|Description||If a stockpile only has adamantine thread allowed, nothing will be stored there. If a stockpile only has adamantine cloth allowed, all types of cloth will be stored there. |
All of my cloth and thread is in bins.
I have two stockpiles set up, one for adamntine strands and cloth, and the other for all other cloth plus leather.
In the stockpile settings on the adamntine stockpile I have everything except adamantine thread and cloth forbidden and everything except adamntine thread and cloth allowed in the other stockpile.
My dwarves were storing the adamntine thread in the regular thread and cloth stockpile, so I had the adamntine thread stockpile take from the regular thread and cloth stockpile, then my dwarves start moving bins of regular thread and cloth to the adamntine only stockpile and did not take out the regular thread or cloth. Most bins did not even have adamntine stuff in them. Strangely they would not take all of the bins either. And if I set number of bins to 0 then nothing would be stored in the stockpile.
I double checked the stockpile settings on both and confirmed that they are correct.
|Steps To Reproduce||Have two stockpiles, a lot of cloth and thread in bins, and some adamantine strands. Set one stockpile to forbid adamantine strands and cloth but allow the rest of the cloth category. Do the opposite for the other stockpile.|
Dwarves will store adamantine strands in the wrong stockpile.
Have the adamantine strand stockpile take from the regular stockpile.
Dwarves will start moving bins of regular cloth to the adamantine stockpile.
|Additional Information||Phoebus graphics pack|
|yep, still the case for 34.11|
Possible workaround (not mine):
I got curious about that workaround and looked at the code. It turns out this bug is most likely caused by the same uninitalized reference array in the material structure that crashes the economy if it is enabled via memory hacking (as found by Quietust).
Basically, for use in stockpiling and economy, the game pre-sorts the materials into a certain set of groups; here is the list of them:
This sorting process fills an array of vectors with material ids, and also sets things up for reverse lookup by storing the index of each material id within the material id vector inside the matching material structure itself.
Unfortunately, while the array inside the material structure that is used to store the reverse lookup references is supposed to be preinitialized with -1, it isn't filled at all, and ends up containing whatever there was in memory before.
As a result, since the most likely value for newly allocated memory contents when DF is just being loaded is 0, thread&cloth end up being matched against index 0 within all categories they don't really belong to (and should thus be referencing -1).
edited on: 2013-02-14 13:45
Specifically, the material descriptor structure contains a 37-element array near the end (between the PREFIX string and the POWDER_DYE/STATE_COLOR temp-strings) which refers to a set of vectors in the raws sub-structure (immediately after the custom building raws and the interactions list), and the values in this array are assumed to be initialized to -1 - the code for stockpiling cloth/thread and for nobles adjusting economy prices both rely on this, the latter actually crashing if this assumption is violated.
Similar references appear to be present inside the creature caste raw structure, between the TRADE_CAPACITY and ATTACK_TRIGGER fields.
edited on: 2013-03-21 19:33
This bug may also be the root cause of 0005569.
Toady One (administrator)
|It looks like I had the values initialized for 0.40.01, changed at some point I don't remember.|
|2012-03-31 18:39||Andrakon||New Issue|
|2012-04-01 09:17||Footkerchief||Relationship added||child of 0004380|
|2012-04-01 09:17||Footkerchief||Relationship added||has duplicate 0004790|
|2012-04-01 09:17||Footkerchief||Relationship added||has duplicate 0004788|
|2012-04-01 09:18||Footkerchief||Relationship added||has duplicate 0004913|
|2012-04-01 09:21||Footkerchief||Relationship added||has duplicate 0004473|
|2012-04-01 09:21||Footkerchief||Relationship added||has duplicate 0005492|
|2012-04-01 09:22||Footkerchief||Relationship replaced||related to 0004380|
|2012-11-03 03:50||Alumine||Note Added: 0023704|
|2013-02-04 08:15||Dwarfu||Relationship added||has duplicate 0006290|
|2013-02-11 12:10||lethosor||Note Added: 0023848|
|2013-02-12 09:43||ag||Note Added: 0023849|
|2013-02-12 09:48||ag||Issue Monitored: ag|
|2013-02-12 09:50||Quietust||Note Added: 0023850|
|2013-02-12 09:53||Quietust||Note Edited: 0023850||View Revisions|
|2013-02-14 13:45||Quietust||Note Edited: 0023850||View Revisions|
|2013-03-21 19:32||Quietust||Note Added: 0023908|
|2013-03-21 19:33||Quietust||Note Edited: 0023908||View Revisions|
|2014-02-19 17:58||Footkerchief||Relationship added||related to 0005569|
|2014-02-19 17:59||Footkerchief||Tag Attached: binary patch|
|2014-03-25 13:18||Dwarfu||Assigned To||=> Dwarfu|
|2014-03-25 13:18||Dwarfu||Status||new => acknowledged|
|2014-07-23 10:40||Toady One||Note Added: 0027328|
|2014-07-23 10:40||Toady One||Status||acknowledged => resolved|
|2014-07-23 10:40||Toady One||Fixed in Version||=> 0.40.01|
|2014-07-23 10:40||Toady One||Resolution||open => fixed|
|2014-07-23 10:40||Toady One||Assigned To||Dwarfu => Toady One|
|Copyright © 2000 - 2010 MantisBT Group|