Corpse generation change

Posted by Meerclar on Tue 26 Nov 2002 08:51 PM — 9 posts, 29,844 views.

USA #0
Here's the deal. I need mpdamage to NOT be treated as a pkill in the event of a fatal dose. I am attempting to modify the generation routine in fight.cpp to include a check for morgue corpse generation in the event the killer is the same as the character. The original check is:

if(GAMESETTING(GAMESET_MORGUE_ENABLED) && !IS_NPC(ch)
&& (!killer || (killer!=ch && IS_NPC(killer) && !killer->master)) )

and what I think should work (doesn't) is:

if(GAMESETTING(GAMESET_MORGUE_ENABLED) && !IS_NPC(ch)
&& (killed_by!=ch->name && !killer || (killer!=ch && IS_NPC(killer) && !killer->master)) )


Any advice would be appreciated on this matter.... especially as we now have places that players very simply cannot retrieve corpses from.
USA #1
killed_by is killer->short_descr not killer->name
USA #2
Oops, see, thats what I get for not having the code in front of me and writing from memory. Anyway, I've tried several combinations, including killer->descr, killer->name, victim->name, and ch->descr plugged into the appropriate locations in the new check. I suspect there may be a placement issue as well but it *shouldn't* matter where in the call the check is made.
USA #3
try:

if(GAMESETTING(GAMESET_MORGUE_ENABLED) && !IS_NPC(ch) && (str_cmp(killed_by,killer->short_descr) && (!killer || killer!=ch) || (IS_NPC(killer) && !killer->master))) 
Amended on Wed 27 Nov 2002 01:09 AM by Cirin
USA #4
Did that happen to work for you?
USA #5
Yet another attempt that looks like it should work but doesnt. For now, I'm walking away from this particular project and the players will simply have to face the risk of an unrecoverable corpse without immortal intervention.
USA #6
One last try. I had to put it in my editing stuff so I could actually look at it on a black background all this white annoys my eyes. This "should" do it, though.

if (GAMESETTING(GAMESET_MORGUE_ENABLED) &&
    !IS_NPC(ch) && str_cmp(killed_by,killer->short_descr) &&
    (!killer || killer!=ch || IS_NPC(killer)) &&
    !killer->master )
USA #7
I'm so close to fixing this I can taste it but there's still something not quite right in the code.... I can either set it so all deaths send corpses to the morgue or mpdamage is treated as standard pkill.... Can't quite find the happy medium I'm looking for
USA #8
Finally managed to get this working about 5 minutes ago. Heres the fix that eventually did what I needed done... mpdamage and npc combat kills to morgue, pkill to room.

if (GAMESETTING(GAMESET_MORGUE_ENABLED) && !IS_NPC(ch)
&& (killer == ch)
|| (IS_NPC(killer) && !killer->master))