mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fix crash with cutting random town
This commit is contained in:
@@ -256,6 +256,8 @@ public:
|
|||||||
h & townAndVis;
|
h & townAndVis;
|
||||||
BONUS_TREE_DESERIALIZATION_FIX
|
BONUS_TREE_DESERIALIZATION_FIX
|
||||||
|
|
||||||
|
if(town)
|
||||||
|
{
|
||||||
vstd::erase_if(builtBuildings, [this](BuildingID building) -> bool
|
vstd::erase_if(builtBuildings, [this](BuildingID building) -> bool
|
||||||
{
|
{
|
||||||
if(!town->buildings.count(building) || !town->buildings.at(building))
|
if(!town->buildings.count(building) || !town->buildings.at(building))
|
||||||
@@ -265,6 +267,7 @@ public:
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
h & overriddenBuildings;
|
h & overriddenBuildings;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user