diff --git a/tests/map_helpers.cpp b/tests/map_helpers.cpp index cea8c4f715412..0f63be073e81d 100644 --- a/tests/map_helpers.cpp +++ b/tests/map_helpers.cpp @@ -35,11 +35,14 @@ void clear_creatures() { // Remove any interfering monsters. g->clear_zombies(); - g->unload_npcs(); } void clear_npcs() { + // Unload and reaload to ensure that all active NPCs are in the + // overmap_buffer. + g->unload_npcs(); + g->load_npcs(); for( npc &n : g->all_npcs() ) { n.die( nullptr ); overmap_buffer.remove_npc( n.getID() ); @@ -72,6 +75,7 @@ void clear_map() } wipe_map_terrain(); g->m.clear_traps(); + clear_npcs(); clear_creatures(); }