Re: [CODE] Dice Limit (was: Oedit limits)

From: Tony Robbins (tonyr@NWPACLINK.COM)
Date: 04/13/98


Del (Panther) wrote:
>
> George wrote:
> > I 'solved' that problem by limiting the dice size in the dice() function.
> > So if you go over the limit, the damage becomes 1. :)
> >
> > A 1000000d20 weapon may cause your MUD to checkpoint crash unless you have
> > a fast machine.
> >
>
> Can you show how you did this? or give some idea please?
>

/* add to the top of dice()    I suggest 12 here */
  int number_limit = <number you want to be the number of dice limit>;
  int size_limit = <number you want to be the size of the dice limit>;

/* down a little bit (after the check that they're greater than 0) */
  if ((number > number_limit) || (size > size_limit)) {
    number = 1;
    size = 1;
  }


     +------------------------------------------------------------+
     | 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/15/00 PST