Monster list iterator
Add some basic functions to iterate through the monster list, ignoring dead monsters. Mainly just to allow splitting up code into discrete functions. Not quite happy with the get_iter_mons_xy - should probably have a pointer to iterator data struct, which gets passed through instead, but this works for now.
This commit is contained in:
8
src/do.c
8
src/do.c
@@ -1839,14 +1839,8 @@ maybe_lvltport_feedback(void)
|
||||
static void
|
||||
final_level(void)
|
||||
{
|
||||
struct monst *mtmp;
|
||||
|
||||
/* reset monster hostility relative to player */
|
||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
if (DEADMONSTER(mtmp))
|
||||
continue;
|
||||
reset_hostility(mtmp);
|
||||
}
|
||||
iter_mons(reset_hostility);
|
||||
|
||||
/* create some player-monsters */
|
||||
create_mplayers(rn1(4, 3), TRUE);
|
||||
|
||||
Reference in New Issue
Block a user