Browse Source

Fixed #909.
Minor fix in using requestActionASAP (capture by val).

Michał W. Urbańczyk 13 years ago
parent
commit
7b7ddf987a
2 changed files with 4 additions and 1 deletions
  1. 1 1
      AI/VCAI/VCAI.cpp
  2. 3 0
      client/CPreGame.cpp

+ 1 - 1
AI/VCAI/VCAI.cpp

@@ -809,7 +809,7 @@ void VCAI::showBlockingDialog(const std::string &text, const std::vector<Compone
 	if(!selection && cancel) //yes&no -> always answer yes, we are a brave AI :)
 		sel = 1;
 
-	requestActionASAP([&]()
+	requestActionASAP([=]()
 	{
 		cb->selectionMade(sel, askID);
 	});

+ 3 - 0
client/CPreGame.cpp

@@ -2114,6 +2114,9 @@ void OptionsTab::flagPressed( int color )
 	if(old)
 	{
 		entries[old->color]->selectButtons();
+		if(old->hero >= 0)
+			usedHeroes.erase(old->hero);
+
 		old->hero = entries[old->color]->pi.defaultHero();
 	}