forked from github/server
cosmetic changes, quick and easy assert to prevent too many magicians.
This commit is contained in:
parent
aa4a93435e
commit
e9c13cc328
|
@ -177,11 +177,9 @@ int count)
|
||||||
}
|
}
|
||||||
if (rtype->flags & RTF_POOLED && mode & ~(GET_SLACK | GET_RESERVE)) {
|
if (rtype->flags & RTF_POOLED && mode & ~(GET_SLACK | GET_RESERVE)) {
|
||||||
for (v = r->units; v && use < count; v = v->next)
|
for (v = r->units; v && use < count; v = v->next)
|
||||||
if (u != v) {
|
if (u != v && (u->items || rtype->uget)) {
|
||||||
int mask;
|
int mask;
|
||||||
|
|
||||||
if (v->items == NULL && rtype->uget == NULL)
|
|
||||||
continue;
|
|
||||||
if ((urace(v)->ec_flags & GIVEITEM) == 0)
|
if ((urace(v)->ec_flags & GIVEITEM) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -1161,10 +1161,13 @@ skill *add_skill(unit * u, skill_t id)
|
||||||
++u->skill_size;
|
++u->skill_size;
|
||||||
u->skills = realloc(u->skills, u->skill_size * sizeof(skill));
|
u->skills = realloc(u->skills, u->skill_size * sizeof(skill));
|
||||||
sv = (u->skills + u->skill_size - 1);
|
sv = (u->skills + u->skill_size - 1);
|
||||||
sv->level = (unsigned char)0;
|
sv->level = 0;
|
||||||
sv->weeks = (unsigned char)1;
|
sv->weeks = 1;
|
||||||
sv->old = (unsigned char)0;
|
sv->old = 0;
|
||||||
sv->id = (unsigned char)id;
|
sv->id = id;
|
||||||
|
if (id == SK_MAGIC && u->faction) {
|
||||||
|
assert(max_magicians(u->faction) >= u->number);
|
||||||
|
}
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue