1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +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; LOCPLINT = this;
playerID=Player; playerID=Player;
human=true; human=true;
battleInt = nullptr; battleInt.reset();
castleInt = nullptr; castleInt = nullptr;
makingTurn = false; makingTurn = false;
showingDialog = new ConditionalWait(); showingDialog = new ConditionalWait();

View File

@@ -332,7 +332,7 @@ void BattleInterface::battleFinished(const BattleResult& br, QueryID queryID)
GH.windows().pushWindow(wnd); GH.windows().pushWindow(wnd);
curInt->waitWhileDialog(); // Avoid freeze when AI end turn after battle. Check bug #1897 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) 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 std::shared_ptr<BattleConsole> BattleWindow::buildBattleConsole(const JsonNode & config) const
{ {
auto rect = readRect(config["rect"]); auto rect = readRect(config["rect"]);

View File

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