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

Function remove_mon_from_reg

src/region.c:191–202  ·  view source on GitHub ↗

* Remove a monster from the region list (it left or died...) */

Source from the content-addressed store, hash-verified

189 * Remove a monster from the region list (it left or died...)
190 */
191void
192remove_mon_from_reg(NhRegion *reg, struct monst *mon)
193{
194 int i;
195
196 for (i = 0; i < reg->n_monst; i++)
197 if (reg->monsters[i] == mon->m_id) {
198 reg->n_monst--;
199 reg->monsters[i] = reg->monsters[reg->n_monst];
200 return;
201 }
202}
203
204/*
205 * Check if a monster is inside the region.

Callers 4

m_in_out_regionFunction · 0.85
update_monster_regionFunction · 0.85
replace_mon_regionsFunction · 0.85
remove_mon_from_regionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected