Re: [CODE] GET_LEVEL(vict) && crash

From: Co-Sysop (dmodem@CYBNETONLINE.COM)
Date: 11/08/97


At 02:29 AM 11/6/97 -0600, you wrote:
>Co-Sysop wrote:
>>
>> I was looking throught the code and came across do_kill().  I looked
>> through it and realized that an imp can kill another imp.  I might just be
>> bored and looking for something to do but the fact that I can't get this
>> right is really bothering me.  I can't get the level of vict until there
>> actually is something in vict.  vict is declared in an if statement.  So
>> right before I get to the part of the else if stuff that tells the mud to
>> kill the vict I add in a few lines:
>>         else if (GET_LEVEL(vict) < LVL_IMPL)
>>           act(message to player like "Don't kill imps");
>
>first off you should use send_to_char, not act.
>Probably the act is cuasing the crash.
>You should try to give more information.
>Any warnings while compiling?

There were no warning while compiling.  That is why I was so puzzled.  It
was in fact the act that was causing the problem.  I do have some info on
how to write an act statement and I probably should have consulted it
before I wrote the statement.  Oh well, live and learn.  I replaced the act
with a send_to_char and everything is okay.  I probably should have put a
[NEWBIE] on that one...

>
>> I compile, run it, and hop into my mud with my imp and type kill newbie.
>> And the mud crashes... Newbie is a normal mob (just to make sure do_kill
>> still works).  In this case vict is a mob.  I haven't tried on a player
>> yet.  But what I want to know is why would this cause a crash?  I doubt it
>> is the act() statement because I basically copied another act() statement

silly me :)

>> and changed the text.  Any insight would be appreciated.  Any flames would
>> be annoying but that doesn't seem to stop anyone.
>>


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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