mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fix battle replaying
This commit is contained in:
parent
26bddbac44
commit
a84c5fa371
@ -67,6 +67,7 @@ void BattleProcessor::startBattlePrimary(const CArmedInstance *army1, const CArm
|
||||
heroes[0] = hero1;
|
||||
heroes[1] = hero2;
|
||||
|
||||
resultProcessor->setupBattle();
|
||||
setupBattle(tile, armies, heroes, creatureBank, town); //initializes stacks, places creatures on battlefield, blocks and informs player interfaces
|
||||
|
||||
auto lastBattleQuery = std::dynamic_pointer_cast<CBattleQuery>(gameHandler->queries->topQuery(gameHandler->gameState()->curB->sides[0].color));
|
||||
|
@ -539,6 +539,12 @@ void BattleResultProcessor::setBattleResult(EBattleResult resultType, int victor
|
||||
gameHandler->gameState()->curB->calculateCasualties(battleResult->casualties);
|
||||
}
|
||||
|
||||
void BattleResultProcessor::setupBattle()
|
||||
{
|
||||
finishingBattle.reset();
|
||||
battleResult.reset();
|
||||
}
|
||||
|
||||
bool BattleResultProcessor::battleIsEnding() const
|
||||
{
|
||||
return battleResult != nullptr;
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
|
||||
bool battleIsEnding() const;
|
||||
|
||||
void setupBattle();
|
||||
void setBattleResult(EBattleResult resultType, int victoriusSide);
|
||||
void endBattle(int3 tile, const CGHeroInstance * hero1, const CGHeroInstance * hero2); //ends battle
|
||||
void endBattleConfirm(const BattleInfo * battleInfo);
|
||||
|
Loading…
Reference in New Issue
Block a user