diff --git a/Mods/vcmi/config/chinese.json b/Mods/vcmi/config/chinese.json index a38a03669..67605102e 100644 --- a/Mods/vcmi/config/chinese.json +++ b/Mods/vcmi/config/chinese.json @@ -85,6 +85,7 @@ "vcmi.spellResearch.research" : "研究此法术", "vcmi.spellResearch.skip" : "跳过此法术", "vcmi.spellResearch.abort" : "中止", + "vcmi.spellResearch.noMoreSpells" : "没有更多的法术可供研究。", "vcmi.mainMenu.serverConnecting" : "连接中...", "vcmi.mainMenu.serverAddressEnter" : "使用地址:", @@ -705,6 +706,8 @@ "core.bonus.DISINTEGRATE.description": "死亡后不会留下尸体", "core.bonus.INVINCIBLE.name": "无敌", "core.bonus.INVINCIBLE.description": "不受任何效果影响", + "core.bonus.MECHANICAL.name": "机械", + "core.bonus.MECHANICAL.description": "免疫大多数效果,可修复", "core.bonus.PRISM_HEX_ATTACK_BREATH.name": "棱光吐息", "core.bonus.PRISM_HEX_ATTACK_BREATH.description": "攻击后向三方向扩散攻击" } diff --git a/Mods/vcmi/config/english.json b/Mods/vcmi/config/english.json index 498741306..2e6af898b 100644 --- a/Mods/vcmi/config/english.json +++ b/Mods/vcmi/config/english.json @@ -85,6 +85,7 @@ "vcmi.spellResearch.research" : "Research this Spell", "vcmi.spellResearch.skip" : "Skip this Spell", "vcmi.spellResearch.abort" : "Abort", + "vcmi.spellResearch.noMoreSpells" : "There are no more spells available for research.", "vcmi.mainMenu.serverConnecting" : "Connecting...", "vcmi.mainMenu.serverAddressEnter" : "Enter address:", diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index ded97d2d3..0c210734a 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -2055,7 +2055,14 @@ void CMageGuildScreen::Scroll::clickPressed(const Point & cursorPosition) auto cost = costBase * std::pow(town->spellResearchAcceptedCounter + 1, costExponent); std::vector> resComps; - auto newSpell = town->spells[level].at(town->spellsAtLevel(level, false)); + + int index = town->spellsAtLevel(level, false); + if (index >= town->spells[level].size()) + { + LOCPLINT->showInfoDialog(CGI->generaltexth->translate("vcmi.spellResearch.noMoreSpells")); + return; + } + auto newSpell = town->spells[level].at(index); resComps.push_back(std::make_shared(ComponentType::SPELL, spell->id)); resComps.push_back(std::make_shared(ComponentType::SPELL, newSpell)); resComps.back()->newLine = true;