mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
Fixed battle replay
This commit is contained in:
@ -2119,7 +2119,7 @@ void BattleStart::applyGs(CGameState * gs) const
|
||||
info->battleID = gs->nextBattleID;
|
||||
info->localInit();
|
||||
|
||||
vstd::next(gs->nextBattleID, 1);
|
||||
gs->nextBattleID = vstd::next(gs->nextBattleID, 1);
|
||||
}
|
||||
|
||||
void BattleNextRound::applyGs(CGameState * gs) const
|
||||
@ -2177,6 +2177,17 @@ void BattleUpdateGateState::applyGs(CGameState * gs) const
|
||||
gs->getBattle(battleID)->si.gateState = state;
|
||||
}
|
||||
|
||||
void BattleCancelled::applyGs(CGameState * gs) const
|
||||
{
|
||||
auto currentBattle = boost::range::find_if(gs->currentBattles, [&](const auto & battle)
|
||||
{
|
||||
return battle->battleID == battleID;
|
||||
});
|
||||
|
||||
assert(currentBattle != gs->currentBattles.end());
|
||||
gs->currentBattles.erase(currentBattle);
|
||||
}
|
||||
|
||||
void BattleResultAccepted::applyGs(CGameState * gs) const
|
||||
{
|
||||
// Remove any "until next battle" bonuses
|
||||
|
Reference in New Issue
Block a user