MantisBT - VCMI
View Issue Details
0002969VCMIModspublic2018-07-16 02:552018-07-17 01:29
SXX 
AVS 
normalminoralways
resolvedfixed 
0.99 
1.next 
0002969: Towns are initialized before articact handler can patch creature handler with war machine ID
So @Andruids reported on slack that his mod of war machine is crashes on attempt to buy his replacement war machine within town. Basically

As I find out problem is that sequence is like this:

* First default siege weapon get loaded by CArtHandler::loadFromJson.
* Then all default towns are initialized by CTownHandler::loadTown. At this point custom war machine creature don't have artifactID.
* Only now CArtHandler::loadFromJson loading our custom war machine artifact so it's where appropriate warmachine ArtifaftID is set for creature.
* Now when you try to open town window ArtifactID::NONE passed to UI and obviously it's cause crash.

VLC->creh->creatures.at(id)->warMachine = art->id;
No tags attached.
zip plaguetent.zip (122,945) 2018-07-16 02:55
https://bugs.vcmi.eu/file_download.php?file_id=2914&type=bug
Issue History
2018-07-16 02:55SXXNew Issue
2018-07-16 02:55SXXStatusnew => assigned
2018-07-16 02:55SXXAssigned To => AVS
2018-07-16 02:55SXXFile Added: plaguetent.zip
2018-07-17 01:29AVSNote Added: 0007588
2018-07-17 01:29AVSStatusassigned => resolved
2018-07-17 01:29AVSFixed in Version => 1.next
2018-07-17 01:29AVSResolutionopen => fixed

Notes
(0007588)
AVS   
2018-07-17 01:29   
Fixed in https://github.com/vcmi/vcmi/pull/459 [^]