mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Fixed some cases of illegal access to std::array::operator[]
This commit is contained in:
@@ -666,6 +666,7 @@ CStackWindow::CStackWindow(const CStack * stack, bool popup)
|
||||
{
|
||||
info->stack = stack;
|
||||
info->stackNode = stack->base;
|
||||
info->commander = dynamic_cast<const CCommanderInstance*>(stack->base);
|
||||
info->creature = stack->unitType();
|
||||
info->creatureCount = stack->getCount();
|
||||
info->popupWindow = popup;
|
||||
|
@@ -257,7 +257,15 @@ CHeroClass * CHeroClassHandler::loadFromJson(const std::string & scope, const Js
|
||||
|
||||
VLC->generaltexth->registerString(scope, heroClass->getNameTextID(), node["name"].String());
|
||||
|
||||
heroClass->affinity = vstd::find_pos(affinityStr, node["affinity"].String());
|
||||
if (vstd::contains(affinityStr, node["affinity"].String()))
|
||||
{
|
||||
heroClass->affinity = vstd::find_pos(affinityStr, node["affinity"].String());
|
||||
}
|
||||
else
|
||||
{
|
||||
logGlobal->error("Mod '%s', hero class '%s': invalid affinity '%s'! Expected 'might' or 'magic'!", scope, identifier, node["affinity"].String());
|
||||
heroClass->affinity = CHeroClass::MIGHT;
|
||||
}
|
||||
|
||||
fillPrimarySkillData(node, heroClass, PrimarySkill::ATTACK);
|
||||
fillPrimarySkillData(node, heroClass, PrimarySkill::DEFENSE);
|
||||
|
Reference in New Issue
Block a user