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
1 changed files with 4 additions and 0 deletions

View File

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