Page 1 of 1

Hack workaround for unkillable NPC

Posted: Sun Jul 17, 2011 1:44 am
by Noel
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:

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 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.

Re: Hack workaround for unkillable NPC

Posted: Mon Jul 18, 2011 8:31 am
by darkgod
Ahah right I already had the fix, but in the wrong location (Actor instead of NPC)
Thanks :)