[Code] float & int

From: I Chose No Name (MUDaholic@AOL.COM)
Date: 12/03/97


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



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