MantisBT - VCMI
View Issue Details
0000964VCMIGUI - Hero screen / Exchange windowpublic2012-05-22 10:212014-05-30 17:41
Warmonger 
Ivan 
urgentcrashalways
closedfixed 
PCWindows 7SP1
 
0.890.89 
0000964: Assertion fail when drawing stack/commander artifact in CreatureWindow
It worked well before image improvements were added. The assumption that artifactImage is non-existant seems wrong, as it's a part of Creature Window.

assert(!vstd::contains(children, child));

addChild(artifactImage = new CAnimImage("ARTIFACT", creatureArtifact->artType->id, 0, 466, 100), true);

I'm living it for Ivan, he knows what it was supposed to do.
Commander artifacts now drop as random relics. Creature artifacts can be added in editor.
No tags attached.
Issue History
2012-05-22 10:21WarmongerNew Issue
2012-05-22 10:21WarmongerStatusnew => assigned
2012-05-22 10:21WarmongerAssigned To => Ivan
2012-05-22 15:38IvanNote Added: 0002519
2012-05-22 16:22IvanNote Added: 0002520
2012-05-22 17:18WarmongerNote Added: 0002523
2012-05-22 17:18WarmongerStatusassigned => resolved
2012-05-22 17:18WarmongerFixed in Version => 0.89
2012-05-22 17:18WarmongerResolutionopen => fixed
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0002519)
Ivan   
2012-05-22 15:38   
Probably you're trying to add already present child to object.
This may happen if you have OBJ_CONSTRUCTION macro in scope. As result any CIntObject-based class will get parent during construction.

To fix - either remove addChild (it will be called in CIntObject construction)
OR add BLOCK_CAPTURING macro before call.
(0002520)
Ivan   
2012-05-22 16:22   
Sorry - don't have sources right now. This should fix it:
function void CCreatureWindow::setArt
add OBJ_CONSTRUCTION_CAPTURING_ALL macro at the beginning and remove addChild call. This should be all.
(0002523)
Warmonger   
2012-05-22 17:18   
Fixed crash. However, I'm not sure how properly set CAnimImage to display no artifact at all. But we cna live with it in dev release.