Assert that magicians are single-person units in a few places.

Bug 2028 claims that this is not always the case, though I cannot prove it.
This commit is contained in:
Enno Rehling 2014-10-31 22:03:00 +01:00
parent 483a2ba3de
commit 5b6663cad7
1 changed files with 3 additions and 2 deletions

View File

@ -702,6 +702,7 @@ void set_level(unit * u, skill_t sk, int value)
{
skill *sv = u->skills;
assert(sk != SK_MAGIC || is_monsters(u->faction) || u->number == 1);
if (!skill_enabled(sk))
return;
@ -1165,8 +1166,8 @@ skill *add_skill(unit * u, skill_t id)
sv->weeks = 1;
sv->old = 0;
sv->id = id;
if (id == SK_MAGIC && u->faction) {
assert(max_magicians(u->faction) >= u->number);
if (id == SK_MAGIC && u->faction && !is_monsters(u->faction)) {
assert(u->number==1 && max_magicians(u->faction) >= u->number);
}
return sv;
}