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

Minor fixes. Support for resource generation special.

This commit is contained in:
DjWarmonger 2010-07-06 10:02:38 +00:00
parent 742e80b168
commit 74364865ff
2 changed files with 6 additions and 8 deletions

View File

@ -1004,14 +1004,13 @@ void CGHeroInstance::initObj()
break;
case 7://maxed mastery for spell
bonus.type = Bonus::MAXED_SPELL;
bonus.val = it->val; //spell id
speciality.bonuses.push_back (bonus);
break;
case 8://peculiar spells - enchantments
bonus.type = Bonus::SPECIAL_PECULIAR_ENCHANT;
bonus.val = it->val; //spell id
bonus.subtype = it->subtype; //0, 1 for Coronius
speciality.bonuses.push_back (bonus);
break;
case 9://upgrade creatures
bonus.type = Bonus::SPECIAL_UPGRADE;
bonus.additionalInfo = it->additionalinfo;
@ -1033,7 +1032,6 @@ void CGHeroInstance::initObj()
break;
case 12://army speed
bonus.type = Bonus::STACKS_SPEED;
bonus.val = it->val;
speciality.bonuses.push_back (bonus);
break;
case 13://Dragon bonuses (Mutare)
@ -1049,6 +1047,7 @@ void CGHeroInstance::initObj()
speciality.bonuses.push_back (bonus);
}
}
break;
default:
tlog2 << "Unexpected hero speciality " << type <<'\n';
}

View File

@ -976,11 +976,10 @@ void CGameHandler::newTurn()
n.res[i->first][6] += 500;
break;
}
for(std::list<Bonus>::iterator j = h->bonuses.begin(); j != h->bonuses.end(); j++)
if(j->type == Bonus::GENERATE_RESOURCE)
n.res[i->first][j->subtype] += j->val;
for (int k = 0; k < RESOURCE_QUANTITY; k++)
{
n.res[i->first][k] += h->valOfBonuses(Bonus::GENERATE_RESOURCE, k);
}
//TODO player bonuses
}