mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +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;
|
int count = 0;
|
||||||
for(auto & elem : allowedHeroes)
|
for(auto & elem : allowedHeroes)
|
||||||
{
|
{
|
||||||
CHero * type = VLC->heroh->objects[elem];
|
const CHero * type = elem.toHeroType();
|
||||||
if(type->heroClass->faction == selectedFaction)
|
if(type->heroClass->faction == selectedFaction)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user