1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

- Unban hero if related Prison is destroyed during map generation

- Move prison counter to PrisonHeroPlacer
This commit is contained in:
Tomasz Zieliński
2023-12-24 09:36:26 +01:00
parent b0f0e9caa8
commit ebf2055afc
9 changed files with 72 additions and 23 deletions

View File

@ -650,10 +650,17 @@ void CMap::banWaterHeroes()
void CMap::banHero(const HeroTypeID & id)
{
if (!vstd::contains(allowedHeroes, id))
logGlobal->warn("Attempt to ban hero %d, who is already not allowed", id.encode(id));
logGlobal->warn("Attempt to ban hero %s, who is already not allowed", id.encode(id));
allowedHeroes.erase(id);
}
void CMap::unbanHero(const HeroTypeID & id)
{
if (vstd::contains(allowedHeroes, id))
logGlobal->warn("Attempt to unban hero %s, who is already allowed", id.encode(id));
allowedHeroes.insert(id);
}
void CMap::initTerrain()
{
terrain.resize(boost::extents[levels()][width][height]);