1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-17 20:58:07 +02:00

Fix possible crash on replaying combat after manual run

This commit is contained in:
Ivan Savenko 2024-05-23 11:36:18 +00:00
parent f8a206b0c6
commit 2aec3cde2c
4 changed files with 2 additions and 8 deletions

View File

@ -137,7 +137,7 @@ CPlayerInterface::CPlayerInterface(PlayerColor Player):
LOCPLINT = this;
playerID=Player;
human=true;
battleInt = nullptr;
battleInt.reset();
castleInt = nullptr;
makingTurn = false;
showingDialog = new ConditionalWait();

View File

@ -332,7 +332,7 @@ void BattleInterface::battleFinished(const BattleResult& br, QueryID queryID)
GH.windows().pushWindow(wnd);
curInt->waitWhileDialog(); // Avoid freeze when AI end turn after battle. Check bug #1897
CPlayerInterface::battleInt = nullptr;
CPlayerInterface::battleInt.reset();
}
void BattleInterface::spellCast(const BattleSpellCast * sc)

View File

@ -192,11 +192,6 @@ void BattleWindow::createTimerInfoWindows()
}
}
BattleWindow::~BattleWindow()
{
CPlayerInterface::battleInt = nullptr;
}
std::shared_ptr<BattleConsole> BattleWindow::buildBattleConsole(const JsonNode & config) const
{
auto rect = readRect(config["rect"]);

View File

@ -82,7 +82,6 @@ class BattleWindow : public InterfaceObjectConfigurable
public:
BattleWindow(BattleInterface & owner );
~BattleWindow();
/// Closes window once battle finished
void close();