1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

A few fixes for artifacts.

This commit is contained in:
Michał W. Urbańczyk
2011-01-18 18:56:14 +00:00
parent a9c98d2b8c
commit 898ad292ea
17 changed files with 312 additions and 205 deletions

View File

@ -1379,11 +1379,7 @@ void CGameState::init( StartInfo * si, ui32 checksum, int Seed )
toGive = VLC->arth->artifacts[VLC->arth->getRandomArt (CArtifact::ART_TREASURE)];
CGHeroInstance *hero = k->second.heroes[0];
std::vector<ui16>::iterator slot = vstd::findFirstNot (hero->artifWorn, toGive->possibleSlots);
if(slot != toGive->possibleSlots.end())
VLC->arth->equipArtifact(hero->artifWorn, *slot, toGive);
else
hero->giveArtifact(toGive->id);
hero->giveArtifact(toGive->id);
}
}
}
@ -2675,7 +2671,7 @@ struct statsHLP
int ret = 0;
for(int g=0; g<ps->heroes.size(); ++g)
{
ret += ps->heroes[g]->artifacts.size() + ps->heroes[g]->artifWorn.size();
ret += ps->heroes[g]->artifactsInBackpack.size() + ps->heroes[g]->artifactsWorn.size();
}
return ret;
}