1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #3592 from godric3/map-editor-fixes

Map editor - fix submod list and mine resources
This commit is contained in:
DjWarmonger
2024-02-03 13:13:19 +01:00
committed by GitHub
3 changed files with 12 additions and 4 deletions

View File

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

View File

@@ -204,6 +204,15 @@ void MapController::repairMap(CMap * map) const
art->storedArtifact = a; 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();
}
}
} }
} }

View File

@@ -78,9 +78,8 @@ void ModSettings::initialize(MapController & c)
auto pieces = qmodName.split("."); auto pieces = qmodName.split(".");
assert(pieces.size() > 1); assert(pieces.size() > 1);
QString qs; pieces.pop_back();
for(int i = 0; i < pieces.size() - 1; ++i) auto qs = pieces.join(".");
qs += pieces[i];
if(addedMods.count(qs)) if(addedMods.count(qs))
{ {