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

BattleInfo stacks are now unique_ptr's

This commit is contained in:
Ivan Savenko
2025-03-17 21:21:39 +00:00
parent c02a8a84fd
commit 0101d5ff67
4 changed files with 30 additions and 31 deletions

View File

@ -341,9 +341,9 @@ const IBonusBearer* CStack::getBonusBearer() const
bool CStack::unitHasAmmoCart(const battle::Unit * unit) const
{
for(const CStack * st : battle->stacks)
for(const auto & st : battle->stacks)
{
if(battle->battleMatchOwner(st, unit, true) && st->unitType()->getId() == CreatureID::AMMO_CART)
if(battle->battleMatchOwner(st.get(), unit, true) && st->unitType()->getId() == CreatureID::AMMO_CART)
{
return st->alive();
}