mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-13 22:06:58 +02:00
- added check to avoid recursion in AI town building code
- restored previously missing AI shield during AI turn
This commit is contained in:
parent
f8028f512d
commit
881a7cf862
@ -928,6 +928,12 @@ void VCAI::recruitCreatures(const CGDwelling * d)
|
|||||||
|
|
||||||
bool VCAI::tryBuildStructure(const CGTownInstance * t, BuildingID building, unsigned int maxDays)
|
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))
|
if (!vstd::contains(t->town->buildings, building))
|
||||||
return false; // no such building in town
|
return false; // no such building in town
|
||||||
|
|
||||||
|
@ -115,11 +115,11 @@ class VCAI : public CAdventureAI
|
|||||||
//internal methods for town development
|
//internal methods for town development
|
||||||
|
|
||||||
//try build an unbuilt structure in maxDays at most (0 = indefinite)
|
//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
|
//try build ANY unbuilt structure
|
||||||
bool tryBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=0);
|
bool tryBuildAnyStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=7);
|
||||||
//try build first unbuilt structure
|
//try build first unbuilt structure
|
||||||
bool tryBuildNextStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=0);
|
bool tryBuildNextStructure(const CGTownInstance * t, std::vector<BuildingID> buildList, unsigned int maxDays=7);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
friend class FuzzyHelper;
|
friend class FuzzyHelper;
|
||||||
|
@ -627,6 +627,9 @@ void CMinimap::setAIRadar(bool on)
|
|||||||
vstd::clear_pointer(aiShield);
|
vstd::clear_pointer(aiShield);
|
||||||
update();
|
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)
|
void CMinimap::hideTile(const int3 &pos)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user