Browse Source

Access CHero in a way that will throw exception on invalid access
instead of crash

Ivan Savenko 1 year ago
parent
commit
76cb5387c5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      client/lobby/OptionsTab.cpp

+ 1 - 1
client/lobby/OptionsTab.cpp

@@ -503,7 +503,7 @@ void OptionsTab::SelectionWindow::recreate()
 			int count = 0;
 			for(auto & elem : allowedHeroes)
 			{
-				CHero * type = VLC->heroh->objects[elem];
+				const CHero * type = elem.toHeroType();
 				if(type->heroClass->faction == selectedFaction)
 				{
 					count++;