mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-07 00:58:39 +02:00
Stacks of armed instance are now unique_ptr
This commit is contained in:
@ -777,9 +777,9 @@ std::shared_ptr<CGCreature> ObjectManager::chooseGuard(si32 strength, bool zoneG
|
||||
|
||||
auto guard = std::dynamic_pointer_cast<CGCreature>(guardFactory->create(map.mapInstance->cb, nullptr));
|
||||
guard->character = CGCreature::HOSTILE;
|
||||
auto * hlp = new CStackInstance(creId, amount);
|
||||
auto hlp = std::make_unique<CStackInstance>(creId, amount);
|
||||
//will be set during initialization
|
||||
guard->putStack(SlotID(0), hlp);
|
||||
guard->putStack(SlotID(0), std::move(hlp));
|
||||
return guard;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user