mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
Stacks of armed instance are now unique_ptr
This commit is contained in:
@ -104,7 +104,7 @@ void DwellingInstanceConstructor::randomizeObject(CGDwelling * dwelling, vstd::R
|
||||
JsonRandom::Variables emptyVariables;
|
||||
for(auto & stack : randomizer.loadCreatures(guards, rng, emptyVariables))
|
||||
{
|
||||
dwelling->putStack(SlotID(dwelling->stacksCount()), new CStackInstance(stack.getId(), stack.count));
|
||||
dwelling->putStack(SlotID(dwelling->stacksCount()), std::make_unique<CStackInstance>(stack.getId(), stack.count));
|
||||
}
|
||||
}
|
||||
else if (dwelling->ID == Obj::CREATURE_GENERATOR1 || dwelling->ID == Obj::CREATURE_GENERATOR4)
|
||||
@ -125,7 +125,7 @@ void DwellingInstanceConstructor::randomizeObject(CGDwelling * dwelling, vstd::R
|
||||
for(auto creatureEntry : availableCreatures)
|
||||
{
|
||||
const CCreature * crea = creatureEntry.at(0);
|
||||
dwelling->putStack(SlotID(dwelling->stacksCount()), new CStackInstance(crea->getId(), crea->getGrowth() * 3));
|
||||
dwelling->putStack(SlotID(dwelling->stacksCount()), std::make_unique<CStackInstance>(crea->getId(), crea->getGrowth() * 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user