mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge branch 'battle-dialog' into battle-dialog2
# Conflicts: # AI/BattleAI/BattleAI.h # AI/StupidAI/StupidAI.h # client/CPlayerInterface.cpp # client/CPlayerInterface.h # client/Client.cpp # client/NetPacksClient.cpp # client/battle/CBattleInterface.cpp # client/battle/CBattleInterface.h # client/battle/CBattleInterfaceClasses.cpp # client/battle/CBattleInterfaceClasses.h # config/schemas/settings.json # lib/CGameInterface.h # lib/IGameEventsReceiver.h # lib/NetPacks.h # lib/NetPacksLib.cpp # lib/battle/BattleInfo.cpp # server/CGameHandler.cpp # server/CQuery.h
This commit is contained in:
@@ -386,6 +386,28 @@ bool CGarrisonDialogQuery::blocksPack(const CPack * pack) const
|
||||
|
||||
return CDialogQuery::blocksPack(pack);
|
||||
}
|
||||
|
||||
CBattleDialogQuery::CBattleDialogQuery(CGameHandler * owner, const BattleInfo * Bi):
|
||||
CDialogQuery(owner)
|
||||
{
|
||||
bi = Bi;
|
||||
|
||||
for(auto & side : bi->sides)
|
||||
addPlayer(side.color);
|
||||
}
|
||||
|
||||
void CBattleDialogQuery::onRemoval(PlayerColor color)
|
||||
{
|
||||
assert(answer);
|
||||
if(*answer == 1)
|
||||
{
|
||||
gh->startBattlePrimary(bi->sides[0].armyObject, bi->sides[1].armyObject, bi->tile, bi->sides[0].hero, bi->sides[1].hero, bi->creatureBank, bi->town);
|
||||
}
|
||||
else
|
||||
{
|
||||
gh->endBattleConfirm(bi);
|
||||
}
|
||||
}
|
||||
|
||||
CBattleDialogQuery::CBattleDialogQuery(CGameHandler * owner, const BattleInfo * Bi):
|
||||
CDialogQuery(owner)
|
||||
|
||||
Reference in New Issue
Block a user