Re: A crash bug and 2 questions

From: NITRO (SB7230477@v9001.ntu.ac.sg)
Date: 02/08/95


From:	IN%"panama@free.org"  "Panama N. Red"  9-FEB-1995 11:44:38.70
To:	IN%"circle@concrete.resnet.upenn.edu"
CC:	IN%"circle@pvv.unit.no"
Subj:	A crash bug and 2 questions


>Lastly, I wanted to make player-killing impossible.  So I went to the 
>do_damage (I think that is what it is called)

>and put a little line of code after the shopkeeper protection code that 
>said 
>if (!IS_NPC(ch) && !IS_NPC(victim))
>{
>send_to_char("You can't kill players here!\n\r", ch);
>return;
>}
>This works GREAT except that if someone is poisoned it gives the 
>character that message every tick.  So if they quaff a poison 
>potion....it says every tick instead of you feel burning in your blood 
>and suffer.......You can't kill players here!
>I assume it is doing this because the ch is also the victim when you 
>quaff something.  So how do I fix this so that with objects poison works 
>but when someone casts the spell on another player it just plain doesn't 
>work.
>
>Thanks,
>Sala
>insomnia@arcade.com
>arcade.com 1111
>


 From what i see, 


 (1) do a 

     if(!IS_NPC(ch) && !IS_NPC(victim) && !(is_affected(victim, AFF_POISON) )) 
     {
      send_to_char("No player killing!\n\r",ch);
      return;
     }

    

 Another better way would be to include in players' specials.act with

 
 #define PLR_NO_KILL_PLAYER   (1<<16)


 modify your functions accordingly and make all players unable to kill
 other players. In fact, it is more fool proof than have a checking
 statement above.....


 just my two pence worth...



 Nitro who could be wrong....:P
 sb7230477@omega.ntu.ac.sg



This archive was generated by hypermail 2b30 : 12/07/00 PST