forked from github/server
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:
parent
483a2ba3de
commit
5b6663cad7
|
@ -702,6 +702,7 @@ void set_level(unit * u, skill_t sk, int value)
|
||||||
{
|
{
|
||||||
skill *sv = u->skills;
|
skill *sv = u->skills;
|
||||||
|
|
||||||
|
assert(sk != SK_MAGIC || is_monsters(u->faction) || u->number == 1);
|
||||||
if (!skill_enabled(sk))
|
if (!skill_enabled(sk))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1165,8 +1166,8 @@ skill *add_skill(unit * u, skill_t id)
|
||||||
sv->weeks = 1;
|
sv->weeks = 1;
|
||||||
sv->old = 0;
|
sv->old = 0;
|
||||||
sv->id = id;
|
sv->id = id;
|
||||||
if (id == SK_MAGIC && u->faction) {
|
if (id == SK_MAGIC && u->faction && !is_monsters(u->faction)) {
|
||||||
assert(max_magicians(u->faction) >= u->number);
|
assert(u->number==1 && max_magicians(u->faction) >= u->number);
|
||||||
}
|
}
|
||||||
return sv;
|
return sv;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue