View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006440 | Dwarf Fortress | Artistic Images (engravings etc) | public | 2014-02-21 08:26 | 2014-07-23 10:28 |
Reporter | Quietust | Assigned To | Toady One | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | 0.34.11 | ||||
Fixed in Version | 0.40.05 | ||||
Summary | 0006440: Art facet modifiers not properly applied for creature images, casting wrong pointer | ||||
Description | When trading decorated items with caravans, items bearing images of creatures are intended to adjust their value according to certain properties (e.g. GOOD, EVIL, FANCIFUL, OWN_RACE), but this logic does not appear to work correctly. It looks like it's trying to caste a pointer of type "art_image_elementst" to "art_image_element_creaturest", but it's using the pointer for the art_image itself rather than the element within it; as a result, the race/caste values are complete garbage (specifically, pointers inside an std::vector). | ||||
Additional Information | This was found during analysis of version 0.23.130.23a and subsequently confirmed to still exist in version 0.34.11. | ||||
Tags | binary patch | ||||
related to | 0001285 | acknowledged | Figurine motifs do not influence value during trade |
|
Effectively, the code appears to be as follows: art_image *img = improvements[i]->getImage(); ... if (img->elements[i]->getType() == ART_IMAGE_ELEMENT_CREATURE) { art_image_element_creaturest *element = (art_image_element_creaturest *)img; // should be img->elements[i] value += getCreatureImageValue(entity, element->race, element->caste); } |
|
And now that this bug has been tagged with "binary patch", I feel obligated to actually provide one: Win32 0.34.11 SDL: 0x01305A5 : 0F B7 4E 08 66 8B 46 0C -> 66 8B 41 0C 0F B7 49 08 |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-02-21 08:26 | Quietust | New Issue | |
2014-02-21 08:30 | Quietust | Note Added: 0024547 | |
2014-02-21 10:54 |
|
Tag Attached: binary patch | |
2014-02-25 20:16 | Quietust | Note Added: 0024568 | |
2014-03-06 10:05 |
|
Relationship added | related to 0001285 |
2014-03-25 13:16 |
|
Assigned To | => user11 |
2014-03-25 13:16 |
|
Status | new => acknowledged |
2014-07-23 10:28 | Toady One | Status | acknowledged => resolved |
2014-07-23 10:28 | Toady One | Fixed in Version | => Next Version |
2014-07-23 10:28 | Toady One | Resolution | open => fixed |
2014-07-23 10:28 | Toady One | Assigned To | user11 => Toady One |