MantisBT - VCMI
View Issue Details
0003064VCMIMechanics - Town structurespublic2019-05-20 20:262019-06-04 22:25
Povelitel 
Dydzio 
normalcrashalways
resolvedfixed 
0.99 
0.next 
0003064: accident when opening the list of cities
I just explored the map, and then clicked on the list of cities and got a crash.
VCMI 0.99 6ddebfd43e16a7c1f9717a71bd6852a01a397787 (client) MXE build
No tags attached.
related to 0002561resolved Dydzio Some buildings are treated as invalid, crash when right-clicking on its icon in event window 
png crash.png (23,174) 2019-05-20 20:26
https://bugs.vcmi.eu/file_download.php?file_id=3017&type=bug
png

rar клик по списку городов.rar (644,613) 2019-05-20 20:27
https://bugs.vcmi.eu/file_download.php?file_id=3018&type=bug
txt VCMI_Client_log.txt (390,677) 2019-05-20 20:27
https://bugs.vcmi.eu/file_download.php?file_id=3019&type=bug
txt VCMI_Server_log.txt (365,341) 2019-05-20 20:27
https://bugs.vcmi.eu/file_download.php?file_id=3020&type=bug
Issue History
2019-05-20 20:26PovelitelNew Issue
2019-05-20 20:26PovelitelFile Added: crash.png
2019-05-20 20:27PovelitelFile Added: клик по списку городов.rar
2019-05-20 20:27PovelitelFile Added: VCMI_Client_log.txt
2019-05-20 20:27PovelitelFile Added: VCMI_Server_log.txt
2019-06-02 18:47DydzioNote Added: 0007807
2019-06-02 18:48DydzioRelationship addedrelated to 0002561
2019-06-04 20:36DydzioAssigned To => Dydzio
2019-06-04 20:36DydzioStatusnew => assigned
2019-06-04 20:37DydzioNote Added: 0007810
2019-06-04 22:25AVSStatusassigned => resolved
2019-06-04 22:25AVSFixed in Version => 0.next
2019-06-04 22:25AVSResolutionopen => fixed

Notes
(0007807)
Dydzio   
2019-06-02 18:47   
Well, this bug is related to weird thing I do not understand in VCMI code - buildings with ID 27, 28, 29 (extra town hall, extra city hall, extra capitol). They get added automatically tobuilt buildings on map start (and maybe on game load?) if appropiate income building is built - code in CMapLoaderH3M::convertBuildings

In this save building with ID 27 exists but it's data is NULL and there is attempt to read it which causes crash.
(0007810)
Dydzio   
2019-06-04 20:37   
Fixed in: https://github.com/vcmi/vcmi/pull/602 [^]

Save will be broken after fix, but starting the map again will have no error.