1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +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

@ -260,12 +260,12 @@ TEST_F(CGameStateTest, DISABLED_issue2765)
const CStack * att = nullptr;
const CStack * def = nullptr;
for(const CStack * s : gameState->currentBattles.front()->stacks)
for(const auto & s : gameState->currentBattles.front()->stacks)
{
if(s->unitType()->getId() == CreatureID::BALLISTA && s->unitSide() == BattleSide::DEFENDER)
def = s;
def = s.get();
else if(s->unitType()->getId() == CreatureID(69) && s->unitSide() == BattleSide::ATTACKER)
att = s;
att = s.get();
}
ASSERT_NE(att, nullptr);
ASSERT_NE(def, nullptr);