Somehow, the NPC was still in level.entities, but was marked dead. Haven't figured out how that happened yet.
Adding this hack to the beginning of _M:die() in game/modules/tome/class/NPC.lua worked to get rid of the worm mass:
Code: Select all
function _M:die(src)
if self.dead then
print('[HACK] Removing already-dead NPC from level: uid= ', self.uid)
game.level:removeEntity(self)
end
This was early enough in the game that I had the whole log in my scrollback buffer (Linux, so no automatic logging to file).
Attaching the log file. I also have the save file as of the end of the log, if that helps -- forum doesn't allow .teag files to be uploaded.