Re: Annoying Bug.......

From: Ray (ruppertr@SNYCORVA.CORTLAND.EDU)
Date: 12/18/97


On Thu, 18 Dec 1997, John Evans wrote:

> On Thu, 18 Dec 1997, Chuck Carson wrote:
>
[snip!]
>
> #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....

Wow, I shouldn't be answering this without looking at the code, but what
is "cell" good for?  you get the following values

flag:cell
1 : 32
2 : 16
3 : 10.66...
4 : 8
5 : 6.4

etc.

Seems like an odd series of numbers...

But assuming that it's a good thing, and that's what you want, why not
use 32/(flag+1) thus changing the table to be

0:32
1:16
2:10.66...
.
.
.

Just a bit confused,
                  Ray

P.S.  I'm a math major.  These things bother me.


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