mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-18 03:21:27 +02:00
Merge pull request #273 from dydzio0614/CommanderCrash
Ah right, I forgot about this bug :/. Thanks.
This commit is contained in:
commit
1e38b29add
@ -822,8 +822,8 @@ void CStackWindow::init()
|
|||||||
info->stackNode = new CStackInstance(info->creature, 1);// FIXME: free data
|
info->stackNode = new CStackInstance(info->creature, 1);// FIXME: free data
|
||||||
|
|
||||||
selectedIcon = nullptr;
|
selectedIcon = nullptr;
|
||||||
selectedSkill = 0;
|
selectedSkill = -1;
|
||||||
if (info->levelupInfo)
|
if (info->levelupInfo && !info->levelupInfo->skills.empty())
|
||||||
selectedSkill = info->levelupInfo->skills.front();
|
selectedSkill = info->levelupInfo->skills.front();
|
||||||
|
|
||||||
commanderTab = nullptr;
|
commanderTab = nullptr;
|
||||||
@ -913,6 +913,6 @@ CStackWindow::CStackWindow(const CCommanderInstance * commander, std::vector<ui3
|
|||||||
|
|
||||||
CStackWindow::~CStackWindow()
|
CStackWindow::~CStackWindow()
|
||||||
{
|
{
|
||||||
if (info->levelupInfo)
|
if (info->levelupInfo && !info->levelupInfo->skills.empty())
|
||||||
info->levelupInfo->callback(vstd::find_pos(info->levelupInfo->skills, selectedSkill));
|
info->levelupInfo->callback(vstd::find_pos(info->levelupInfo->skills, selectedSkill));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user