more monster iteration

Re-use the array allocated for iterating over all monsters during
monster movement much of the time.  It was being allocated from
scratch for each round of monster movement, then freed after they
moved, then repeated the next round.
This commit is contained in:
PatR
2024-01-25 23:59:32 -08:00
parent 9cd1a571ae
commit 17414c500a
3 changed files with 37 additions and 12 deletions

View File

@@ -1184,8 +1184,7 @@ freedynamicdata(void)
/* move-specific data */
dmonsfree(); /* release dead monsters */
if (gi.itermonarr)
free((genericptr_t) gi.itermonarr), gi.itermonarr = NULL;
alloc_itermonarr(0U); /* a request of 0 releases existing allocation */
/* level-specific data */
done_object_cleanup(); /* maybe force some OBJ_FREE items onto map */