CID 204092: Memory - illegal accesses (NEGATIVE_RETURNS)

This commit is contained in:
Enno Rehling 2019-09-19 05:05:13 +02:00
parent 96facd21d9
commit 8433052c64
1 changed files with 1 additions and 1 deletions

View File

@ -531,8 +531,8 @@ static int tolua_unit_setskill(lua_State * L)
bool rcmod = tolua_toboolean(L, 4, 0); bool rcmod = tolua_toboolean(L, 4, 0);
skill_t sk = findskill(skname); skill_t sk = findskill(skname);
if (rcmod) level -= u_race(u)->bonus[sk];
if (sk != NOSKILL) { if (sk != NOSKILL) {
if (rcmod) level -= u_race(u)->bonus[sk];
set_level(u, sk, level); set_level(u, sk, level);
lua_pushinteger(L, level); lua_pushinteger(L, level);
return 1; return 1;