In later libcod versions (basically anything that's been out there for 5 years or so) you can kick bots, so, implement that instead. (kick bots on map end, load new map, load new bots)