mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Access CHero in a way that will throw exception on invalid access
instead of crash
This commit is contained in:
parent
0dce278a3b
commit
76cb5387c5
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user