mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Ensure that ghost stacks are created only by BattleStacksRemoved packet.
This will allow client to receive notification.
This commit is contained in:
@@ -5606,6 +5606,20 @@ void CGameHandler::runBattle()
|
||||
|
||||
const BattleInfo & curB = *gs->curB;
|
||||
|
||||
std::set <const CStack *> stacksToRemove;
|
||||
for(auto stack : curB.stacks)
|
||||
{
|
||||
if(vstd::contains(stack->state, EBattleStackState::GHOST_PENDING))
|
||||
stacksToRemove.insert(stack);
|
||||
}
|
||||
|
||||
for(auto stack : stacksToRemove)
|
||||
{
|
||||
BattleStacksRemoved bsr;
|
||||
bsr.stackIDs.insert(stack->ID);
|
||||
sendAndApply(&bsr);
|
||||
}
|
||||
|
||||
//stack loop
|
||||
|
||||
const CStack *next;
|
||||
|
||||
Reference in New Issue
Block a user