MCPcopy Create free account
hub / github.com/NetHack/NetHack / spell_idx

Function spell_idx

src/spell.c:2378–2387  ·  view source on GitHub ↗

return index for spell otyp, or UNKNOWN_SPELL if not found */

Source from the content-addressed store, hash-verified

2376
2377/* return index for spell otyp, or UNKNOWN_SPELL if not found */
2378int
2379spell_idx(short otyp)
2380{
2381 int i;
2382
2383 for (i = 0; (i < MAXSPELL) && (spellid(i) != NO_SPELL); i++)
2384 if (spellid(i) == otyp)
2385 return i;
2386 return UNKNOWN_SPELL;
2387}
2388
2389/* learn or refresh spell otyp, if feasible; return casting letter or '\0' */
2390char

Callers 1

spelleffectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected