Hack workaround for unkillable NPC

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Noel
Thalore
Posts: 121
Joined: Fri Dec 15, 2006 1:49 am

Hack workaround for unkillable NPC

#1 Post 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.
Attachments
unkillable.zip
Log of session creating unkillable NPC
(32.16 KiB) Downloaded 99 times

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Hack workaround for unkillable NPC

#2 Post by darkgod »

Ahah right I already had the fix, but in the wrong location (Actor instead of NPC)
Thanks :)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply