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

Function pray_revive

src/pray.c:2176–2195  ·  view source on GitHub ↗

return TRUE if praying revived a pet corpse */

Source from the content-addressed store, hash-verified

2174
2175/* return TRUE if praying revived a pet corpse */
2176staticfn boolean
2177pray_revive(void)
2178{
2179 struct obj *otmp;
2180
2181 for (otmp = svl.level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere)
2182 if ((otmp->otyp == CORPSE || otmp->otyp == STATUE)
2183 && has_omonst(otmp)
2184 && OMONST(otmp)->mtame && !OMONST(otmp)->isminion)
2185 break;
2186
2187 if (!otmp)
2188 return FALSE;
2189
2190 if (otmp->otyp == CORPSE)
2191 return (revive(otmp, TRUE) != NULL);
2192 else {
2193 return (animate_statue(otmp, u.ux, u.uy, ANIMATE_SPELL, NULL) != NULL);
2194 }
2195}
2196
2197/* #pray command */
2198int

Callers 1

prayer_doneFunction · 0.85

Calls 2

reviveFunction · 0.85
animate_statueFunction · 0.85

Tested by

no test coverage detected