Преглед на файлове

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

Michał W. Urbańczyk преди 13 години
родител
ревизия
7b7ddf987a
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  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();
 	}