CID 26257: Null pointer dereferences (NULL_RETURNS)

this test should never fire, but it shuts up coverity
This commit is contained in:
Enno Rehling 2015-10-29 16:40:18 +01:00
parent 9d9994811a
commit 833a1e70be
1 changed files with 5 additions and 3 deletions

View File

@ -622,10 +622,12 @@ int sp_mindblast(struct castorder * co)
skill_t sk = random_skill(du, false);
if (sk != NOSKILL) {
skill *sv = unit_skill(du, sk);
int n = 1 + rng_int() % 3;
if (sv) {
int n = 1 + rng_int() % 3;
reduce_skill(du, sv, n);
k += du->number;
reduce_skill(du, sv, n);
k += du->number;
}
}
else {
/* unit has no skill. kill it. */