setting max_spelllevel correctly on load.

This commit is contained in:
Enno Rehling 2009-07-17 05:19:05 +00:00
parent 29e423fab4
commit 29bb5f4ceb

View file

@ -1539,11 +1539,15 @@ readgame(const char * filename, int mode, int backup)
mage = get_mage(u); mage = get_mage(u);
if (mage) { if (mage) {
faction * f = u->faction; faction * f = u->faction;
int skl = effskill(u, SK_MAGIC);
if (!is_monsters(f) && f->magiegebiet==M_GRAY) { if (!is_monsters(f) && f->magiegebiet==M_GRAY) {
log_error(("faction %s had magic=gray, fixing (%s)\n", log_error(("faction %s had magic=gray, fixing (%s)\n",
factionname(f), magic_school[mage->magietyp])); factionname(f), magic_school[mage->magietyp]));
f->magiegebiet = mage->magietyp; f->magiegebiet = mage->magietyp;
} }
if (f->max_spelllevel<skl) {
f->max_spelllevel = skl;
}
if (mage->spellcount<0) { if (mage->spellcount<0) {
mage->spellcount = 0; mage->spellcount = 0;
updatespelllist(u); updatespelllist(u);