mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixes
This commit is contained in:
parent
97504364e4
commit
f890037008
@ -1018,9 +1018,9 @@ void CBattleInterface::stackRemoved(int stackID)
|
||||
}
|
||||
}
|
||||
|
||||
delete creAnims[stackID];
|
||||
creAnims.erase(stackID);
|
||||
creDir.erase(stackID);
|
||||
// delete creAnims[stackID];
|
||||
// creAnims.erase(stackID);
|
||||
// creDir.erase(stackID);
|
||||
redrawBackgroundWithHexes(activeStack);
|
||||
queue->update();
|
||||
}
|
||||
@ -3408,8 +3408,13 @@ BattleObjectsByHex CBattleInterface::sortObjectsByHex()
|
||||
|
||||
BattleObjectsByHex sorted;
|
||||
|
||||
auto stacks = curInt->cb->battleGetStacksIf([](const CStack * s)
|
||||
{
|
||||
return !s->isTurret();
|
||||
});
|
||||
|
||||
// Sort creatures
|
||||
for (auto & stack : curInt->cb->battleGetAllStacks())
|
||||
for (auto & stack : stacks)
|
||||
{
|
||||
if(creAnims.find(stack->ID) == creAnims.end()) //e.g. for summoned but not yet handled stacks
|
||||
continue;
|
||||
|
@ -256,11 +256,15 @@ const CStack* CBattleInfoEssentials::battleGetStackByID(int ID, bool onlyAlive)
|
||||
{
|
||||
RETURN_IF_NOT_BATTLE(nullptr);
|
||||
|
||||
for(auto s : battleGetAllStacks(true))
|
||||
if(s->ID == ID && (!onlyAlive || s->alive()))
|
||||
return s;
|
||||
auto stacks = battleGetStacksIf([=](const CStack * s)
|
||||
{
|
||||
return s->ID == ID && (!onlyAlive || s->alive());
|
||||
});
|
||||
|
||||
return nullptr;
|
||||
if(stacks.empty())
|
||||
return nullptr;
|
||||
else
|
||||
return stacks[0];
|
||||
}
|
||||
|
||||
bool CBattleInfoEssentials::battleDoWeKnowAbout(ui8 side) const
|
||||
|
@ -4400,7 +4400,7 @@ bool CGameHandler::makeCustomAction( BattleAction &ba )
|
||||
s->battleCast(spellEnv, parameters);
|
||||
|
||||
sendAndApply(&end_action);
|
||||
if( !gs->curB->battleGetStackByID(gs->curB->activeStack, true))
|
||||
if( !gs->curB->battleGetStackByID(gs->curB->activeStack))
|
||||
{
|
||||
battleMadeAction.setn(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user