1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Merge beta into develop

This commit is contained in:
Ivan Savenko
2023-04-04 16:06:20 +03:00
100 changed files with 3570 additions and 1610 deletions
+12 -4
View File
@@ -609,9 +609,18 @@ void CBattleAI::attemptCastingSpell()
size_t ourUnits = 0;
for(auto unit : all)
std::set<uint32_t> unitIds;
state.battleGetUnitsIf([&](const battle::Unit * u)->bool
{
if(!u->isGhost() && !u->isTurret())
unitIds.insert(u->unitId());
return false;
});
for(auto unitId : unitIds)
{
auto unitId = unit->unitId();
auto localUnit = state.battleGetUnitByID(unitId);
newHealthOfStack[unitId] = localUnit->getAvailableHealth();
@@ -633,9 +642,8 @@ void CBattleAI::attemptCastingSpell()
{
int64_t totalGain = 0;
for(auto unit : all)
for(auto unitId : unitIds)
{
auto unitId = unit->unitId();
auto localUnit = state.battleGetUnitByID(unitId);
auto newValue = getValOr(newValueOfStack, unitId, 0);