1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

- Place all standard visitable objects

- Fixed some constructors
This commit is contained in:
DjWarmonger
2014-07-05 19:35:46 +02:00
parent 22f811ea52
commit 0782557814
4 changed files with 51 additions and 148 deletions

View File

@@ -871,6 +871,12 @@ void CGArtifact::initObj()
blockVisit = true;
if(ID == Obj::ARTIFACT)
{
if (!storedArtifact)
{
auto a = new CArtifactInstance();
cb->gameState()->map->addNewArtifactInstance(a);
storedArtifact = a;
}
if(!storedArtifact->artType)
storedArtifact->setType(VLC->arth->artifacts[subID]);
}
@@ -963,6 +969,11 @@ void CGArtifact::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer)
void CGWitchHut::initObj()
{
if (allowedAbilities.empty()) //this can happen for RMG. regular maps load abilities from map file
{
for (int i = 0; i < GameConstants::SKILL_QUANTITY; i++)
allowedAbilities.push_back(i);
}
ability = *RandomGeneratorUtil::nextItem(allowedAbilities, cb->gameState()->getRandomGenerator());
}