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

Function kill_eggs

src/mon.c:5608–5635  ·  view source on GitHub ↗

kill off any eggs of genocided monsters */

Source from the content-addressed store, hash-verified

5606
5607/* kill off any eggs of genocided monsters */
5608staticfn void
5609kill_eggs(struct obj *obj_list)
5610{
5611 struct obj *otmp;
5612
5613 for (otmp = obj_list; otmp; otmp = otmp->nobj)
5614 if (otmp->otyp == EGG) {
5615 if (dead_species(otmp->corpsenm, TRUE)) {
5616 /*
5617 * It seems we could also just catch this when
5618 * it attempted to hatch, so we wouldn't have to
5619 * search all of the objlists.. or stop all
5620 * hatch timers based on a corpsenm.
5621 */
5622 kill_egg(otmp);
5623 }
5624#if 0 /* not used */
5625 } else if (otmp->otyp == TIN) {
5626 if (dead_species(otmp->corpsenm, FALSE))
5627 otmp->corpsenm = NON_PM; /* empty tin */
5628 } else if (otmp->otyp == CORPSE) {
5629 if (dead_species(otmp->corpsenm, FALSE))
5630 ; /* not yet implemented... */
5631#endif
5632 } else if (Has_contents(otmp)) {
5633 kill_eggs(otmp->cobj);
5634 }
5635}
5636
5637/* kill all members of genocided species */
5638void

Callers 1

kill_genocided_monstersFunction · 0.85

Calls 2

dead_speciesFunction · 0.85
kill_eggFunction · 0.85

Tested by

no test coverage detected