mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Access CHero in a way that will throw exception on invalid access
instead of crash
This commit is contained in:
@@ -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++;
|
||||
|
Reference in New Issue
Block a user