cosmetic changes, quick and easy assert to prevent too many magicians.

This commit is contained in:
Enno Rehling 2014-10-30 17:48:02 +01:00
parent aa4a93435e
commit e9c13cc328
2 changed files with 8 additions and 7 deletions

View File

@ -177,11 +177,9 @@ int count)
}
if (rtype->flags & RTF_POOLED && mode & ~(GET_SLACK | GET_RESERVE)) {
for (v = r->units; v && use < count; v = v->next)
if (u != v) {
if (u != v && (u->items || rtype->uget)) {
int mask;
if (v->items == NULL && rtype->uget == NULL)
continue;
if ((urace(v)->ec_flags & GIVEITEM) == 0)
continue;

View File

@ -1161,10 +1161,13 @@ skill *add_skill(unit * u, skill_t id)
++u->skill_size;
u->skills = realloc(u->skills, u->skill_size * sizeof(skill));
sv = (u->skills + u->skill_size - 1);
sv->level = (unsigned char)0;
sv->weeks = (unsigned char)1;
sv->old = (unsigned char)0;
sv->id = (unsigned char)id;
sv->level = 0;
sv->weeks = 1;
sv->old = 0;
sv->id = id;
if (id == SK_MAGIC && u->faction) {
assert(max_magicians(u->faction) >= u->number);
}
return sv;
}