1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-30 23:18:08 +02:00

Fix positioning of defender units in non-bank battles

This commit is contained in:
Ivan Savenko 2024-09-12 20:11:26 +00:00
parent 75f8614f26
commit 6c0b9415c0

View File

@ -65,10 +65,10 @@ BattleLayout BattleLayout::createLayout(IGameCallback * cb, const std::string &
else
result.units[BattleSide::ATTACKER] = loadUnits(config["attackerUnits"]);
if (attacker->formation == EArmyFormation::LOOSE && !config["defenderUnitsLoose"].isNull())
result.units[BattleSide::DEFENDER] = loadUnits(config["defenderUnitsLoose"][attacker->stacksCount() - 1]);
else if (attacker->formation == EArmyFormation::TIGHT && !config["defenderUnitsTight"].isNull())
result.units[BattleSide::DEFENDER] = loadUnits(config["defenderUnitsTight"][attacker->stacksCount() - 1]);
if (defender->formation == EArmyFormation::LOOSE && !config["defenderUnitsLoose"].isNull())
result.units[BattleSide::DEFENDER] = loadUnits(config["defenderUnitsLoose"][defender->stacksCount() - 1]);
else if (defender->formation == EArmyFormation::TIGHT && !config["defenderUnitsTight"].isNull())
result.units[BattleSide::DEFENDER] = loadUnits(config["defenderUnitsTight"][defender->stacksCount() - 1]);
else
result.units[BattleSide::DEFENDER] = loadUnits(config["defenderUnits"]);