1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Move ghost creation to inner battle loop

This commit is contained in:
AlexVinS 2016-03-01 11:07:45 +03:00
parent 42af83f0dd
commit e3e27b9bfe

View File

@ -5606,6 +5606,12 @@ void CGameHandler::runBattle()
const BattleInfo & curB = *gs->curB;
//stack loop
const CStack *next;
while(!battleResult.get() && (next = curB.getNextStack()) && next->willMove())
{
std::set <const CStack *> stacksToRemove;
for(auto stack : curB.stacks)
{
@ -5620,11 +5626,6 @@ void CGameHandler::runBattle()
sendAndApply(&bsr);
}
//stack loop
const CStack *next;
while(!battleResult.get() && (next = curB.getNextStack()) && next->willMove())
{
//check for bad morale => freeze
int nextStackMorale = next->MoraleVal();
if( nextStackMorale < 0 &&