forked from github/server
CID 22554: Improper use of negative value (REVERSE_NEGATIVE)
I believe this was a false positive, but more asserts can never hurt.
This commit is contained in:
parent
93b7bacff5
commit
e1eb5098d4
|
@ -735,6 +735,7 @@ variant read_unit_reference(struct storage * store)
|
|||
|
||||
int get_level(const unit * u, skill_t id)
|
||||
{
|
||||
assert(id != NOSKILL);
|
||||
if (skill_enabled(id)) {
|
||||
skill *sv = u->skills;
|
||||
while (sv != u->skills + u->skill_size) {
|
||||
|
|
|
@ -45,6 +45,7 @@ const char *skillnames[MAXSKILLS] = {
|
|||
bool skill_disabled[MAXSKILLS];
|
||||
|
||||
bool skill_enabled(skill_t sk) {
|
||||
assert(sk != NOSKILL);
|
||||
return !skill_disabled[sk];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue