Re: [Code] float & int

From: Chuck Carson (chuck@DIGMO.ORG)
Date: 12/04/97


Did you make sure that IS_MAGIC_MOB is evaluating to true?
Add a line right before that to print the value of IS_MAGIC_MOB(victim) to
the room or something. Your problem may lie within that segment of code. Or,
better yet, just change it to !IS_MAGIC_MIOB and see if your dam value
changes. If these are not the case, try some casting, although the values
should come out correctly as you have it lthere.

-CC

-----Original Message-----
From: I Chose No Name <MUDaholic@AOL.COM>
To: CIRCLE@POST.QUEENSU.CA <CIRCLE@POST.QUEENSU.CA>
Date: Wednesday, December 03, 1997 11:09 PM
Subject:  [Code] float & int


>I am trying to multiply a float (1.5) times an int (random number), but the
>int never changes...here's my code:
>
>...
>      if (IS_MAGIC_MOB(victim))
>        dam *= GET_MAG_MULT(weapon);
>...
>
>dam is an int, and GET_MAG_MULT(weapon) is a random number (int),
>but I noticed that the dam wasn't changing at all, so I put a few logs in
to
>report the numbers, and it showd that GET_MAG_MULT(weapon) was 1.5, but
when
>I put a check before and after that piece of code, dam stayed the same.  I
am
>probably just not aware of something you have to do to multiply floats and
>ints together, but please reply, because I have been pondering this for
quite
>a while now (strange, I pretty much copied the shop sellprofit...hmm...)
>
>
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>     +------------------------------------------------------------+
>


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