Hack workaround for unkillable NPC
Posted: Sun Jul 17, 2011 1:44 am
Running a halfling temporal warden, I ended up (again) with an unkillable white worm mass. It was standing on top of one of the Trollmire scrolls, so I had to figure out some way to get rid of it...
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:
This is running svn r3868 on Ubuntu Maverick (10.10).
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.
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.