1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Ban Navigation on maps without water

This commit is contained in:
Tomasz Zieliński
2023-07-18 10:54:36 +02:00
parent 025b0814c8
commit 03b3771f19
5 changed files with 24 additions and 1 deletions

View File

@ -585,6 +585,7 @@ void CMap::banWaterContent()
banWaterHeroes();
banWaterArtifacts();
banWaterSpells();
banWaterSkills();
}
void CMap::banWaterSpells()
@ -617,6 +618,21 @@ void CMap::banWaterArtifacts()
}
}
void CMap::banWaterSkills()
{
for (int j = 0; j < allowedAbilities.size(); j++)
{
if (allowedAbilities[j])
{
auto* skill = dynamic_cast<const CSkill*>(VLC->skills()->getByIndex(j));
if (skill->onlyOnWaterMap && !isWaterMap())
{
allowedAbilities[j] = false;
}
}
}
}
void CMap::banWaterHeroes()
{
for (int j = 0; j < allowedHeroes.size(); j++)