warning fix in sp_lev.c

In function 'create_monster',
    inlined from 'lspo_monster' at sp_lev.c:3385:5:
sp_lev.c:2169:32: warning: 'tmpmons.m_lev_adj' may be used uninitialized [-Wmaybe-uninitialized]
 2169 |             if (mtmp->m_lev + m->m_lev_adj > 49)
      |                               ~^~~~~~~~~~~
sp_lev.c: In function 'lspo_monster':
sp_lev.c:3217:13: note: 'tmpmons.m_lev_adj' was declared here
 3217 |     monster tmpmons;
      |             ^~~~~~~
This commit is contained in:
nhmall
2026-03-24 10:05:48 -04:00
parent 39a4111104
commit d929adc85c

View File

@@ -3241,6 +3241,7 @@ lspo_monster(lua_State *L)
tmpmons.has_invent = DEFAULT_INVENT;
tmpmons.waiting = 0;
tmpmons.mm_flags = NO_MM_FLAGS;
tmpmons.m_lev_adj = 0;
if (argc == 1 && lua_type(L, 1) == LUA_TSTRING) {
const char *paramstr = luaL_checkstring(L, 1);