diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 195d752e2..b3e68359d 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -343,7 +343,9 @@ ui64 evaluateDanger(crint3 tile, const CGHeroInstance *visitor) if (dangerousObject) { //TODO: don't downcast objects AI shouldnt know about! - objectDanger *= fh->getTacticalAdvantage(visitor, dynamic_cast(dangerousObject)); + auto armedObj = dynamic_cast(dangerousObject); + if(armedObj) + objectDanger *= fh->getTacticalAdvantage(visitor, armedObj); } }