This is stumping me a little bit and I'm wondering if I'm running into memory/heap corruption or something from SwapMaps. I've got a list of "hero" objects and when adding the second hero, the first one in the list is becoming null. I've tracked it down to the following line.
That line has nothing to do with the hero list but when I remove it, the first hero doesn't get nulled.
var/mob/Hero/h = new();
calls this code.
m_Map = Proc_CreateNewMapFromTemplate("CustomMap")
which calls this code.
var/swapmap/M = SwapMaps_CreateFromTemplate(templateName)
Which in turn is nulling out the first hero in m_listOfHeroes.
Ah, I just found an map_CustomMap.txt file in my maps directory with the following:
//Orphan savefile buffer '' found on Mon Mar 30 17:09:24 2015
//End of exported data.
Not sure how important that find is.
Anyway, stuck at this point.