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

Function update_monster_region

src/region.c:597–611  ·  view source on GitHub ↗

* Ditto for a specified monster. */

Source from the content-addressed store, hash-verified

595 * Ditto for a specified monster.
596 */
597void
598update_monster_region(struct monst *mon)
599{
600 int i;
601
602 for (i = 0; i < svn.n_regions; i++) {
603 if (inside_region(gr.regions[i], mon->mx, mon->my)) {
604 if (!mon_in_region(gr.regions[i], mon))
605 add_mon_to_reg(gr.regions[i], mon);
606 } else {
607 if (mon_in_region(gr.regions[i], mon))
608 remove_mon_from_reg(gr.regions[i], mon);
609 }
610 }
611}
612
613#if 0
614/* not yet used */

Callers 3

rloc_to_coreFunction · 0.85
mdisplacemFunction · 0.85
do_entityFunction · 0.85

Calls 4

inside_regionFunction · 0.85
mon_in_regionFunction · 0.85
add_mon_to_regFunction · 0.85
remove_mon_from_regFunction · 0.85

Tested by

no test coverage detected