From 918452d37c870a6e0587bddad3b8dedbe8689609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Tue, 17 Apr 2012 15:08:38 +0000 Subject: [PATCH] Fixed #930. --- AI/VCAI/VCAI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); } }