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)) {
|
||||
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue