diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 7700be90d..7f52fcf51 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -928,6 +928,12 @@ void VCAI::recruitCreatures(const CGDwelling * d) bool VCAI::tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays) { + if (maxDays == 0) + { + logAi->warnStream() << "Request to build building " << building << " in 0 days!"; + return false; + } + if (!vstd::contains(t->town->buildings, building)) return false; // no such building in town diff --git a/AI/VCAI/VCAI.h b/AI/VCAI/VCAI.h index 9c52b3d24..4dac0eac7 100644 --- a/AI/VCAI/VCAI.h +++ b/AI/VCAI/VCAI.h @@ -115,11 +115,11 @@ class VCAI : public CAdventureAI //internal methods for town development //try build an unbuilt structure in maxDays at most (0 = indefinite) - bool tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays=0); + bool tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays=7); //try build ANY unbuilt structure - bool tryBuildAnyStructure(const CGTownInstance * t, std::vector buildList, unsigned int maxDays=0); + bool tryBuildAnyStructure(const CGTownInstance * t, std::vector buildList, unsigned int maxDays=7); //try build first unbuilt structure - bool tryBuildNextStructure(const CGTownInstance * t, std::vector buildList, unsigned int maxDays=0); + bool tryBuildNextStructure(const CGTownInstance * t, std::vector buildList, unsigned int maxDays=7); public: friend class FuzzyHelper; diff --git a/client/AdventureMapClasses.cpp b/client/AdventureMapClasses.cpp index b3fd46252..b7de70ef2 100644 --- a/client/AdventureMapClasses.cpp +++ b/client/AdventureMapClasses.cpp @@ -627,6 +627,9 @@ void CMinimap::setAIRadar(bool on) vstd::clear_pointer(aiShield); update(); } + // this my happen during AI turn when this interface is inactive + // force redraw in order to properly update interface + GH.totalRedraw(); } void CMinimap::hideTile(const int3 &pos)