1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Fix mine resource and productivity on map load, also made them non editable

This commit is contained in:
godric3 2024-02-03 11:30:09 +01:00
parent b2cd92d937
commit ec735aa959
2 changed files with 10 additions and 1 deletions

View File

@ -370,7 +370,7 @@ void Inspector::updateProperties(CGMine * o)
addProperty("Owner", o->tempOwner, false);
addProperty("Resource", o->producedResource);
addProperty("Productivity", o->producedQuantity, false);
addProperty("Productivity", o->producedQuantity);
}
void Inspector::updateProperties(CGResource * o)

View File

@ -204,6 +204,15 @@ void MapController::repairMap(CMap * map) const
art->storedArtifact = a;
}
}
//fix mines
if(auto * mine = dynamic_cast<CGMine*>(obj.get()))
{
if(!mine->isAbandoned())
{
mine->producedResource = GameResID(mine->subID);
mine->producedQuantity = mine->defaultResProduction();
}
}
}
}