mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-19 12:02:24 +02:00
CCreatureHandler: fix native terrain for any
This commit is contained in:
parent
a0de223901
commit
cabe228ebc
@ -327,12 +327,12 @@ bool CCreature::isItNativeTerrain(TerrainId terrain) const
|
|||||||
|
|
||||||
TerrainId CCreature::getNativeTerrain() const
|
TerrainId CCreature::getNativeTerrain() const
|
||||||
{
|
{
|
||||||
const std::string cachingStringNoTerrainPenalty = "type_NO_TERRAIN_PENALTY";
|
const std::string cachingStringNoTerrainPenalty = "type_NO_TERRAIN_PENALTY_sANY";
|
||||||
static const auto selectorNoTerrainPenalty = Selector::type()(Bonus::NO_TERRAIN_PENALTY);
|
static const auto selectorNoTerrainPenalty = Selector::typeSubtype(Bonus::NO_TERRAIN_PENALTY, static_cast<int>(ETerrainId::ANY_TERRAIN));
|
||||||
|
|
||||||
//this code is used in the CreatureTerrainLimiter::limit to setup battle bonuses
|
//this code is used in the CreatureTerrainLimiter::limit to setup battle bonuses
|
||||||
//and in the CGHeroInstance::getNativeTerrain() to setup movement bonuses or/and penalties.
|
//and in the CGHeroInstance::getNativeTerrain() to setup movement bonuses or/and penalties.
|
||||||
return hasBonus(selectorNoTerrainPenalty, selectorNoTerrainPenalty)
|
return hasBonus(selectorNoTerrainPenalty, cachingStringNoTerrainPenalty)
|
||||||
? TerrainId(ETerrainId::ANY_TERRAIN)
|
? TerrainId(ETerrainId::ANY_TERRAIN)
|
||||||
: (*VLC->townh)[faction]->nativeTerrain;
|
: (*VLC->townh)[faction]->nativeTerrain;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user