deal with light sources in discard_migrations()
Otherwise, when discard_migrations() purges monsters, their stale monster pointers can be left inside the light source data structure.
This commit is contained in:
@@ -914,6 +914,8 @@ discard_migrations(void)
|
|||||||
mtmp->nmon = 0;
|
mtmp->nmon = 0;
|
||||||
discard_minvent(mtmp, FALSE);
|
discard_minvent(mtmp, FALSE);
|
||||||
/* bypass mongone() and its call to m_detach() plus dmonsfree() */
|
/* bypass mongone() and its call to m_detach() plus dmonsfree() */
|
||||||
|
if (emits_light(mtmp->data))
|
||||||
|
del_light_source(LS_MONSTER, monst_to_any(mtmp));
|
||||||
dealloc_monst(mtmp);
|
dealloc_monst(mtmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user