mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +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
|
||||
{
|
||||
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->getCurrentTerrain() == terrainType)
|
||||
return ILimiter::EDecision::ACCEPT;
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto * unit = dynamic_cast<const CStackInstance*>(&context.node);
|
||||
if (unit->getCurrentTerrain() == terrainType)
|
||||
if (unit->getArmy() && unit->getCurrentTerrain() == terrainType)
|
||||
return ILimiter::EDecision::ACCEPT;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user