Prevent crash when opening stack's info window in fort
This commit is contained in:
1 parent
81db5c7cf4
commit
6ee1e7a5c7
1 file changed
+2
-9
@@ -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