mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix possible crash on replaying combat after manual run
This commit is contained in:
		| @@ -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(); | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -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"]); | ||||
|   | ||||
| @@ -82,7 +82,6 @@ class BattleWindow : public InterfaceObjectConfigurable | ||||
|  | ||||
| public: | ||||
| 	BattleWindow(BattleInterface & owner ); | ||||
| 	~BattleWindow(); | ||||
|  | ||||
| 	/// Closes window once battle finished | ||||
| 	void close(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user