Re: Annoying Bug.......

From: John Evans (evansj@HI-LINE.NET)
Date: 12/18/97


On Thu, 18 Dec 1997, Chuck Carson wrote:

> Can anyone help me figure this out? The mud crashes every time a mob hits a
> death trap (now that I think about it, I believe only mobs with one of the
> below bits set, AGGR's). Here is the code causing the crash. This is stock
> code except for the intial if statement, I have added the 128 bit vector
> code and must test each flag individually (instead of MOB_FLAGGED(ch, XXXX |
> XXXXXX)). This however is unrelated. The mud has no problem getting by this
> line. When it enters the for loop, crashola. This code, from the binary
> level, should be no different than the stock code. This is driving me crazy.
>

Oh Oh Oh Oh Oh!!!!

Damn... I had a similar problem and it just clicked!!

Sorry for not realizing this earlier... You stated that you had done the
128 bits "upgrade" and then this bug popped up. I don't have my code
accessable at the moment, but in structs.h you probably have something
like this:


#define MOB_AGGR        0       /* Aggr mob */
#define MOB_FLAG1       1       /* flag 1 */
.... etc ....

You need to change that to:
#define MOB_DO_NOT_USE  0       /* NEVER NEVER NEVER USE!! */
#define MOB_AGGR        1       /* Aggr mob */
#define MOB_FLAG1       2       /* flag 2 */

What's happening is that to figure out which portion of the array to play
with the number (0, 1, 2) is divided into 32.. Like so:

cell = 32 / flag;

If 'flag' equals zero, then you have a division by zero and a crash....

My crash was when someone had the KILLER bit turned on because that was
"bit" zero. Just make sure that NONE of your MOB_XXX OBJ_XXX ROOM_XXX
PRF_XXX or PLR_XXX flags are #defined to 0.

Yes, changing this data will change the flags on your currently existing
mob prototypes (It'll shift em all one notch), but if you just did a 128
bit conversion, you either wiped the world, or converted it all.

I hope that this explanation made sense, because all of this is from
memory at the moment. :)


John Evans <evansj@hi-line.net>
http://www.hi-line.net/~evansj/

Duct tape is like the force.
It has a light side, a dark side and it binds the universe together.


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