Re: [Circle] CODE: color stat prompt.

From: Niese-Petersen (Tenp@cris.com)
Date: 07/26/96


On Fri, 26 Jul 1996, Terry Valladon wrote:

<--snip-->
> 
>     if (PRF_FLAGGED(d->character, PRF_DISPHP))
>       if (GET_HIT(d->character) <= (GET_MAX_HIT(d->character)*1))
>          if (GET_HIT(d->character) >= (GET_MAX_HIT(d->character)*.504))
>              sprintf(prompt, "%s%s%dH%s|", prompt, CCGRN(d->character, C_NRM),
>              GET_HIT(d->character), CCNRM(d->character, C_NRM));
>          if (GET_HIT(d->character) >= (GET_MAX_HIT(d->character)*.254))
>              if (GET_HIT(d->character) <= (GET_MAX_HIT(d->character)*.506))
> 	     sprintf(prompt, "%s%s%dH%s|", prompt, CCYEL(d->character, C_NRM),
>              GET_HIT(d->character), CCNRM(d->character, C_NRM));
> 	 if (GET_HIT(d->character) <= (GET_MAX_HIT(d->character)*.256))
>              sprintf(prompt, "%s%s%dH%s|", prompt, CCRED(d->character, C_NRM),
>              GET_HIT(d->character), CCNRM(d->character, C_NRM));
> 
<-- some more snip-->

Ok.. You multiply a float (.504 , .254 , .506 , .256) to integers ..
Don't think C wanna do that to much, without you telling it what you work
with .. like:

  if( ((float) GET_HIT(d->character)) >= (((float) GET_MAX_HIT(d->character))*.504))
    sprintf(blah);   etc..


---
Erik Niese-Petersen
Aka Quint The typo God
Realms of Darkness IMP [matrix.xiii.com 6666. Playertesting]


+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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