1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-28 03:57:02 +02:00

Fixed levelling up of commander

This commit is contained in:
Ivan Savenko 2014-07-03 01:00:16 +03:00
parent b58bbcbdd8
commit 328944e111

View File

@ -623,7 +623,12 @@ void CStackWindow::init()
selectedIcon = nullptr;
selectedSkill = 0;
if (info->levelupInfo)
{
selectedSkill = info->levelupInfo->skills.front();
logGlobal->debugStream() << "Received commander level-up. Possible options are: ";
for (auto skill : info->levelupInfo->skills)
logGlobal->debugStream() << "Skill #" << skill;
}
commanderTab = nullptr;
activeTab = 0;
@ -709,6 +714,7 @@ CStackWindow::~CStackWindow()
{
if (info->levelupInfo)
{
info->levelupInfo->callback(selectedSkill);
logGlobal->debugStream() << "Selected skill was " << selectedSkill;
info->levelupInfo->callback(vstd::find_pos(info->levelupInfo->skills, selectedSkill));
}
}