mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-09 13:14:02 +02:00
Fix excessive removal of dialogs, e.g. new week or timed events
This commit is contained in:
parent
d1aa55de91
commit
b6cc409772
@ -193,11 +193,6 @@ void CPlayerInterface::closeAllDialogs()
|
|||||||
castleInt->close();
|
castleInt->close();
|
||||||
|
|
||||||
castleInt = nullptr;
|
castleInt = nullptr;
|
||||||
|
|
||||||
// remove all pending dialogs that do not expect query answer
|
|
||||||
vstd::erase_if(dialogs, [](const std::shared_ptr<CInfoWindow> & window){
|
|
||||||
return window->ID == QueryID::NONE;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerInterface::playerEndsTurn(PlayerColor player)
|
void CPlayerInterface::playerEndsTurn(PlayerColor player)
|
||||||
@ -207,6 +202,11 @@ void CPlayerInterface::playerEndsTurn(PlayerColor player)
|
|||||||
{
|
{
|
||||||
makingTurn = false;
|
makingTurn = false;
|
||||||
closeAllDialogs();
|
closeAllDialogs();
|
||||||
|
|
||||||
|
// remove all pending dialogs that do not expect query answer
|
||||||
|
vstd::erase_if(dialogs, [](const std::shared_ptr<CInfoWindow> & window){
|
||||||
|
return window->ID == QueryID::NONE;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1511,7 +1511,7 @@ void CPlayerInterface::update()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//if there are any waiting dialogs, show them
|
//if there are any waiting dialogs, show them
|
||||||
if ((CSH->howManyPlayerInterfaces() <= 1 || makingTurn) && !dialogs.empty() && !showingDialog->isBusy())
|
if (makingTurn && !dialogs.empty() && !showingDialog->isBusy())
|
||||||
{
|
{
|
||||||
showingDialog->setBusy();
|
showingDialog->setBusy();
|
||||||
GH.windows().pushWindow(dialogs.front());
|
GH.windows().pushWindow(dialogs.front());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user