Noch eine Division by zero. Testdurchlauf gemacht, funktioniert schienbar alles.

This commit is contained in:
Enno Rehling 2002-02-03 02:54:47 +00:00
parent 7bed85420b
commit 1c917f070e
1 changed files with 22 additions and 5 deletions

View File

@ -333,7 +333,7 @@ count_skill(faction * f, skill_t skill)
for (r = firstregion(f); r != last; r = r->next) for (r = firstregion(f); r != last; r = r->next)
for (u = r->units; u; u = u->next) for (u = r->units; u; u = u->next)
if (u->faction == f && get_skill(u, skill) > 0) if (u->faction == f && get_skill(u, skill))
if(!is_familiar(u)) if(!is_familiar(u))
n += u->number; n += u->number;
@ -3072,3 +3072,20 @@ reorder_owners(region * r)
assert(len==listlen(r->units)); assert(len==listlen(r->units));
#endif #endif
} }
int
produceexp(struct unit * u, skill_t sk, int n)
{
if (n==0 || !playerrace(u->race)) return 0;
#if SKILLPOINTS
change_skill(u, SK_HERBALISM, PRODUCEEXP * n);
return 1;
#else
if (learn_skill(u, SK_HERBALISM, PRODUCEEXP * n)) {
change_skill(u, SK_HERBALISM, n);
return 1;
}
return 0;
#endif
}