1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Merged hero_spells.txt into heroes.json.

This commit is contained in:
Frank Zago
2011-08-27 16:13:44 +00:00
parent fc9282fd50
commit 9594058157
3 changed files with 99 additions and 225 deletions

View File

@ -294,26 +294,13 @@ void CHeroHandler::loadHeroes()
BOOST_FOREACH(const JsonNode &set, hero["skill_set"].Vector()) {
heroes[hid]->secSkillsInit.push_back(std::make_pair(set["skill"].Float(), set["level"].Float()));
}
const JsonNode *value = &hero["spell"];
if (!value->isNull()) {
heroes[hid]->startingSpell = value->Float();
}
}
{
std::ifstream inp;
std::istringstream iss;
dump.clear();
inp.open(DATA_DIR "/config/hero_spells.txt");
while(inp)
{
getline(inp, dump);
if(!dump.size() || dump[0] == '-')
continue;
iss.clear();
iss.str(dump);
int hid, sid;
iss >> hid >> sid;
heroes[hid]->startingSpell = sid;
}
inp.close();
}
loadHeroClasses();
initHeroClasses();
expPerLevel.push_back(0);