Anonymous | Login | 2024-12-14 21:52 UTC |
My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
0002389 | VCMI | GUI - Other | public | 2016-01-19 07:14 | 2016-01-19 10:06 | ||||||||
Reporter | vmarkovtsev | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Platform | Darwin | OS | MacOSX | OS Version | 10.11.2 | ||||||||
Product Version | 0.98f | ||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0002389: CComponent::getSubtitleInternal segfaults on unknown town buildings | ||||||||||||
Description | std::string CComponent::getSubtitleInternal() at client/widgets/CComponent.cpp near line 177 case building: return CGI->townh->factions[subtype]->town->buildings[BuildingID(val)]->Name() If val is not contained in the mapping, nullptr is returned and std::string segfaults later on. | ||||||||||||
Steps To Reproduce | Use map "The Lord of War", load the attached save. End turn. In this particular case, Barbarian town has the following structures: 0: Гильдия Магов 1 уровня 1: Гильдия Магов 2 уровня 2: Гильдия Магов 3 уровня 5: Таверна 7: Форт 8: Цитадель 9: Замок 10: Сельская управа 11: Префектура 12: Муниципалитет 13: Капитолий 14: Рынок 15: Хранилище ресурсов 16: Кузница 17: Чёрный ход 18: Столовая 19: Столовая 21: Гильдия наёмников 22: Двор баллист 23: Храм валгаллы 26: Памятник богам войны But 27 is requested. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files | The Lord of War.h3m [^] (152,581 bytes) 2016-01-19 07:14 save.zip [^] (2,390,088 bytes) 2016-01-19 07:15 | ||||||||||||
Notes | |
(0006310) vmarkovtsev (developer) 2016-01-19 07:39 |
https://github.com/vcmi/vcmi/pull/158 [^] |
(0006311) AVS (administrator) 2016-01-19 08:20 |
The question is why 27 is requested? May be the bug is in other place. |
(0006312) AVS (administrator) 2016-01-19 08:28 |
Looks like Barbarian town has missing entries: "extraTownHall": { "id" : 27, "requires" : [ "townHall" ], "mode" : "auto" }, "extraCityHall": { "id" : 28, "requires" : [ "cityHall" ], "mode" : "auto" }, "extraCapitol": { "id" : 29, "requires" : [ "capitol" ], "mode" : "auto" } Need to check all other towns too. |
(0006313) Warmonger (administrator) 2016-01-19 09:45 |
"Auto" buildings are just decorative and have no own function. There is also no reason to display them in a message. |
(0006314) AVS (administrator) 2016-01-19 10:06 |
Now I found a bug. The problem is that when map is loading, "extra" buildings are added even if the town have no "extra" buildings. CMapLoaderH3M::convertBuildings ... if(ret.find(BuildingID::CITY_HALL) != ret.end()) { ret.insert(BuildingID::EXTRA_CITY_HALL); } if(ret.find(BuildingID::TOWN_HALL) != ret.end()) { ret.insert(BuildingID::EXTRA_TOWN_HALL); } if(ret.find(BuildingID::CAPITOL) != ret.end()) { ret.insert(BuildingID::EXTRA_CAPITOL); } |
Issue History | |||
Date Modified | Username | Field | Change |
2016-01-19 07:14 | vmarkovtsev | New Issue | |
2016-01-19 07:14 | vmarkovtsev | File Added: The Lord of War.h3m | |
2016-01-19 07:15 | vmarkovtsev | File Added: save.zip | |
2016-01-19 07:39 | vmarkovtsev | Note Added: 0006310 | |
2016-01-19 08:20 | AVS | Note Added: 0006311 | |
2016-01-19 08:28 | AVS | Note Added: 0006312 | |
2016-01-19 09:45 | Warmonger | Note Added: 0006313 | |
2016-01-19 10:06 | AVS | Note Added: 0006314 |
Copyright © 2000 - 2024 MantisBT Team |