1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-13 22:06:58 +02:00

Fixed #506. Some really weird issues caused it.

Also fixed #502 - eye radius is now 10.
This commit is contained in:
DjWarmonger 2010-06-21 04:43:10 +00:00
parent db2bde9ae2
commit 53d4b51b26
2 changed files with 14 additions and 2 deletions

View File

@ -1555,6 +1555,10 @@ int CGTownInstance::creatureGrowth(const int & level) const
case 2: case 2:
ret*=(1.5); break; ret*=(1.5); break;
} }
if(tempOwner != NEUTRAL_PLAYER)
{
ret *= (1 + cb->gameState()->players[tempOwner].valOfBonuses(Bonus::CREATURE_GROWTH_PERCENT)/100); //Statue of Legion
}
if(getHordeLevel(0)==level) if(getHordeLevel(0)==level)
if((builtBuildings.find(18)!=builtBuildings.end()) || (builtBuildings.find(19)!=builtBuildings.end())) if((builtBuildings.find(18)!=builtBuildings.end()) || (builtBuildings.find(19)!=builtBuildings.end()))
ret+=VLC->creh->creatures[town->basicCreatures[level]]->hordeGrowth; ret+=VLC->creh->creatures[town->basicCreatures[level]]->hordeGrowth;
@ -5450,7 +5454,7 @@ void CGMagi::onHeroVisit(const CGHeroInstance * h) const
{ {
const CGObjectInstance *eye = cb->getObj(*it); const CGObjectInstance *eye = cb->getObj(*it);
cb->getTilesInRange (fw.tiles, eye->pos, 5, h->tempOwner, 1); cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1);
cb->sendAndApply(&fw); cb->sendAndApply(&fw);
cv.pos = eye->pos; cv.pos = eye->pos;
cv.focusTime = 2000; cv.focusTime = 2000;

View File

@ -185,6 +185,7 @@ void IGameCallback::getAllowedArts(std::vector<CArtifact*> &out, std::vector<CAr
(VLC->arth->*arts).push_back(&(VLC->arth->artifacts[i])); (VLC->arth->*arts).push_back(&(VLC->arth->artifacts[i]));
} }
} }
for (int i = 0; i < (VLC->arth->*arts).size(); i++) for (int i = 0; i < (VLC->arth->*arts).size(); i++)
{ {
CArtifact *art = (VLC->arth->*arts)[i]; CArtifact *art = (VLC->arth->*arts)[i];
@ -205,6 +206,11 @@ void IGameCallback::getAllowed(std::vector<CArtifact*> &out, int flags)
getAllowedArts(out,&CArtHandler::majors, CArtifact::ART_MAJOR); getAllowedArts(out,&CArtHandler::majors, CArtifact::ART_MAJOR);
if(flags & CArtifact::ART_RELIC) if(flags & CArtifact::ART_RELIC)
getAllowedArts(out,&CArtHandler::relics, CArtifact::ART_RELIC); getAllowedArts(out,&CArtHandler::relics, CArtifact::ART_RELIC);
if (!out.size()) //no arts are avaliable
{
out.resize(64);
std::fill_n(out.begin(), 64, &(VLC->arth->artifacts[2])); //magic
}
} }
ui16 IGameCallback::getRandomArt (int flags) ui16 IGameCallback::getRandomArt (int flags)
@ -227,6 +233,8 @@ ui16 IGameCallback::getRandomArt (int flags)
case CArtifact::ART_RELIC: case CArtifact::ART_RELIC:
ptr = &VLC->arth->relics; ptr = &VLC->arth->relics;
break; break;
default: //special artifacts should not be erased
return art->id;
} }
ptr->erase (std::find(ptr->begin(), ptr->end(), art)); //remove the artifact from avaliable list ptr->erase (std::find(ptr->begin(), ptr->end(), art)); //remove the artifact from avaliable list
return art->id; return art->id;