Re: Act.informative.c

From: Adam Days (g98s12@oemsunix.onysd.wednet.edu)
Date: 07/23/96


Why would I multiply instead of dividing?  It needs to be divided
otherwise you come up with some insane # of astrisks.
look at it this way; say you have a persont with 1000/1000 HP (a god)
okay to show his life meter it would go like this with your formula.

1000/50 = 20
kay now say he has full health that's
1000 * 20 = # of astrisks
however, that's not fifty that's 20000

now let's look at it a different way;

1000/50 = 20
1000/20 = 50
that works (in theory)

that SHOULD work for any hit point person, but it doesnt look;

40/50 = .8
40/.8 = 50

All I need to put in is to say that if the number is less that 1 then make
it 1 how do I go about that? and is that a good idea?
On Tue, 23 Jul 1996, Chris Dickey wrote:

>
>
> In this line:
>
> > GET_HPR(ch) = (GET_MAX_HIT(ch) / 50)
>
> if a player's max hps are less than 50, the result will be 0 and the same
> holds for the other.  The error you're getting is the result of
> dividing by 0, a big no-no.  Might wanna do something like:
>
> float val;
> /* find the ratio of max_hit / 50 */
> val = GET_MAX_HIT(ch) / 50;
> /* here you wanna multiply, not divide by the val */
> ASTERISK(ch) = GET_HIT(ch) * val;
>
>
> Christopher
> (awake@dcci.com)
>

*******************************************************************************
 Adam Days  a.k.a		  ** "Being an Outcast is only a frame of mind
 Drizzt Do'Urden                  **  and not something that is placed upon
 Unholy Lands <164.116.34.2 4000> **  you."  -Adam Days
*******************************************************************************



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