mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Prevent crash when opening stack's info window in fort
This commit is contained in:
@@ -287,16 +287,9 @@ ILimiter::EDecision CreatureTerrainLimiter::limit(const BonusLimitationContext &
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (context.node.getNodeType() == BonusNodeType::STACK_BATTLE)
|
if(const auto * unit = retrieveStackInstance(&context.node))
|
||||||
{
|
{
|
||||||
const auto * unit = dynamic_cast<const CStack *>(&context.node);
|
if (unit->getArmy() && unit->getCurrentTerrain() == terrainType)
|
||||||
if (unit->getCurrentTerrain() == terrainType)
|
|
||||||
return ILimiter::EDecision::ACCEPT;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const auto * unit = dynamic_cast<const CStackInstance*>(&context.node);
|
|
||||||
if (unit->getCurrentTerrain() == terrainType)
|
|
||||||
return ILimiter::EDecision::ACCEPT;
|
return ILimiter::EDecision::ACCEPT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user