mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-26 22:57:00 +02:00
Merge pull request #1848 from Nordsoft91/editor-fix
Fix map editor crash with cutting random town
This commit is contained in:
commit
1cb0c6b270
@ -256,15 +256,18 @@ public:
|
|||||||
h & townAndVis;
|
h & townAndVis;
|
||||||
BONUS_TREE_DESERIALIZATION_FIX
|
BONUS_TREE_DESERIALIZATION_FIX
|
||||||
|
|
||||||
vstd::erase_if(builtBuildings, [this](BuildingID building) -> bool
|
if(town)
|
||||||
{
|
{
|
||||||
if(!town->buildings.count(building) || !town->buildings.at(building))
|
vstd::erase_if(builtBuildings, [this](BuildingID building) -> bool
|
||||||
{
|
{
|
||||||
logGlobal->error("#1444-like issue in CGTownInstance::serialize. From town %s at %s removing the bogus builtBuildings item %s", name, pos.toString(), building);
|
if(!town->buildings.count(building) || !town->buildings.at(building))
|
||||||
return true;
|
{
|
||||||
}
|
logGlobal->error("#1444-like issue in CGTownInstance::serialize. From town %s at %s removing the bogus builtBuildings item %s", name, pos.toString(), building);
|
||||||
return false;
|
return true;
|
||||||
});
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
h & overriddenBuildings;
|
h & overriddenBuildings;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user