1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

* fixed project files for RD configuration

* fixed crash when creature is casting Hypnosis (ie. exped Vampire Lords)
* fixed crash when creature is casting Cure before attack (ie. exped Unicorns)
* fixed crash when creature is summoning elemental (TODO fix it)
* fixed crash when doing a bonus system operation with a hero liberated from prison (ie. entering town or battle)
* fixed deadlock when StupidAI tried to assault the turrets
* fixed never ending siege when StupidAI has to use catapult (no more deadlocks on AI-AI siege)
* fixed deadlock when a hero received a level during another player's turn (ie. when he successfully defended)
* AI can win the game by defeating all enemies if there is a specific victory condition applying only to human players
* added options to help testing adventure map AI (--onlyAI, --autoSkip and --oneGoodAI).
* many minor changes
This commit is contained in:
Michał W. Urbańczyk
2012-01-03 01:55:26 +00:00
parent 91c0ce33f4
commit 046e54563c
35 changed files with 305 additions and 107 deletions

View File

@ -1486,6 +1486,25 @@ int CGHeroInstance::movementPointsAfterEmbark(int MPsBefore, int basicCost, bool
return 0; //take all MPs otherwise
}
CGHeroInstance::ECanDig CGHeroInstance::diggingStatus() const
{
std::string hlp;
if(movement < maxMovePoints(true))
return LACK_OF_MOVEMENT;
else if(cb->getTile(getPosition(false))->tertype == TerrainTile::water)
return WRONG_TERRAIN;
else
{
const TerrainTile *t = cb->getTile(getPosition());
//TODO look for hole
//CGI->mh->getTerrainDescr(h->getPosition(false), hlp, false);
if(/*hlp.length() || */t->blockingObjects.size() > 1)
return TILE_OCCUPIED;
else
return CAN_DIG;
}
}
void CGDwelling::initObj()
{
switch(ID)
@ -2392,6 +2411,11 @@ const CArmedInstance * CGTownInstance::getUpperArmy() const
return this;
}
bool CGTownInstance::hasBuilt(int buildingID) const
{
return vstd::contains(builtBuildings, buildingID);
}
void CGVisitableOPH::onHeroVisit( const CGHeroInstance * h ) const
{
if(visitors.find(h->id)==visitors.end())