mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Stabilization
This commit is contained in:
@ -128,7 +128,7 @@ void CGDwelling::pickRandomObject(CRandomGenerator & rand)
|
||||
FactionID faction = randomizeFaction(rand);
|
||||
int level = randomizeLevel(rand);
|
||||
assert(faction != FactionID::NONE && faction != FactionID::NEUTRAL);
|
||||
assert(level >= 1 && level <= 7);
|
||||
assert(level >= 0 && level <= 6);
|
||||
randomizationInfo.reset();
|
||||
|
||||
CreatureID cid = (*VLC->townh)[faction]->town->creatures[level][0];
|
||||
@ -163,6 +163,8 @@ void CGDwelling::pickRandomObject(CRandomGenerator & rand)
|
||||
ID = Obj::CREATURE_GENERATOR4;
|
||||
subID = *RandomGeneratorUtil::nextItem(VLC->objtypeh->knownSubObjects(Obj::CREATURE_GENERATOR1), rand);
|
||||
}
|
||||
|
||||
setType(ID, subID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1547,14 +1547,14 @@ void CGHeroInstance::afterAddToMap(CMap * map)
|
||||
}
|
||||
}
|
||||
|
||||
if(ID == Obj::HERO)
|
||||
if(ID != Obj::PRISON)
|
||||
{
|
||||
map->heroesOnMap.emplace_back(this);
|
||||
}
|
||||
}
|
||||
void CGHeroInstance::afterRemoveFromMap(CMap* map)
|
||||
{
|
||||
if (ID == Obj::HERO)
|
||||
if (ID == Obj::PRISON)
|
||||
vstd::erase_if_present(map->heroesOnMap, this);
|
||||
}
|
||||
|
||||
|
@ -1100,14 +1100,12 @@ void CGTownInstance::onTownCaptured(const PlayerColor & winner) const
|
||||
|
||||
void CGTownInstance::afterAddToMap(CMap * map)
|
||||
{
|
||||
if(ID == Obj::TOWN)
|
||||
map->towns.emplace_back(this);
|
||||
map->towns.emplace_back(this);
|
||||
}
|
||||
|
||||
void CGTownInstance::afterRemoveFromMap(CMap * map)
|
||||
{
|
||||
if (ID == Obj::TOWN)
|
||||
vstd::erase_if_present(map->towns, this);
|
||||
vstd::erase_if_present(map->towns, this);
|
||||
}
|
||||
|
||||
void CGTownInstance::reset()
|
||||
|
Reference in New Issue
Block a user