From 81a00f59d1328a2332e1087a7a290fd49b6f0439 Mon Sep 17 00:00:00 2001 From: dydzio Date: Thu, 2 Feb 2017 19:17:15 +0100 Subject: [PATCH] Basic fix for bug #2635 --- client/windows/CCreatureWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index 039cf0384..ba3abe492 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -822,8 +822,8 @@ void CStackWindow::init() info->stackNode = new CStackInstance(info->creature, 1);// FIXME: free data selectedIcon = nullptr; - selectedSkill = 0; - if (info->levelupInfo) + selectedSkill = -1; + if (info->levelupInfo && !info->levelupInfo->skills.empty()) selectedSkill = info->levelupInfo->skills.front(); commanderTab = nullptr; @@ -913,6 +913,6 @@ CStackWindow::CStackWindow(const CCommanderInstance * commander, std::vectorlevelupInfo) + if (info->levelupInfo && !info->levelupInfo->skills.empty()) info->levelupInfo->callback(vstd::find_pos(info->levelupInfo->skills, selectedSkill)); }