mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Couple fixes
This commit is contained in:
parent
3018178956
commit
cb02e221f3
@ -105,7 +105,9 @@ void MapController::repairMap()
|
||||
}
|
||||
|
||||
//fix owners for objects
|
||||
for(auto obj : _map->objects)
|
||||
auto allImpactedObjects(_map->objects);
|
||||
allImpactedObjects.insert(allImpactedObjects.end(), _map->predefinedHeroes.begin(), _map->predefinedHeroes.end());
|
||||
for(auto obj : allImpactedObjects)
|
||||
{
|
||||
//setup proper names (hero name will be fixed later
|
||||
if(obj->ID != Obj::HERO && obj->ID != Obj::PRISON && (obj->typeName.empty() || obj->subTypeName.empty()))
|
||||
@ -154,12 +156,16 @@ void MapController::repairMap()
|
||||
if(nih->spellbookContainsSpell(SpellID::PRESET))
|
||||
{
|
||||
nih->removeSpellFromSpellbook(SpellID::PRESET);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(auto spellID : type->spells)
|
||||
nih->addSpellToSpellbook(spellID);
|
||||
}
|
||||
if(nih->spellbookContainsSpell(SpellID::SPELLBOOK_PRESET))
|
||||
{
|
||||
nih->removeSpellFromSpellbook(SpellID::SPELLBOOK_PRESET);
|
||||
if(!nih->getArt(ArtifactPosition::SPELLBOOK) && type->haveSpellBook)
|
||||
nih->putArtifact(ArtifactPosition::SPELLBOOK, ArtifactUtils::createNewArtifactInstance(ArtifactID::SPELLBOOK));
|
||||
}
|
||||
|
||||
//fix portrait
|
||||
if(nih->portrait < 0 || nih->portrait == 255)
|
||||
nih->portrait = type->imageIndex;
|
||||
|
@ -90,6 +90,11 @@ void WindowNewMap::loadUserSettings()
|
||||
{
|
||||
ui->heightTxt->setText(height.toString());
|
||||
}
|
||||
for(auto & sz : mapSizes)
|
||||
{
|
||||
if(sz.second.first == width.toInt() && sz.second.second == height.toInt())
|
||||
ui->sizeCombo->setCurrentIndex(sz.first);
|
||||
}
|
||||
auto twoLevel = s.value(newMapTwoLevel);
|
||||
if (twoLevel.isValid())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user