Re: [Circle] NEWBIE NEEDS HELP AGAIN! (*sigh*)

From: Niese-Petersen (Tenp@cris.com)
Date: 08/01/96


On Wed, 31 Jul 1996, Cyber Reaper wrote:

> ok, I have added this code and it is causing a memory fault. can someone
> point out the error to me, I cannot find it, I assume it has to do with the
> (FIGHTING(d->character)) but cant seem to find it.
> 
> ---snip---
>  if (GET_POS(d->character) == 7)
>        sprintf(prompt, "%s%sHIS COND:%s", prompt, CCGRN(d->character, C_NRM),
>        CCNRM(d->character, C_NRM));
> 
>  if (GET_MAX_HIT(FGHTING(d->character)) > 0)
>     percent = (100 * GET_HIT(FGHTING(d->character))) /
> GET_MAX_HIT(d->character);
>   else
>     percent = -1;               /* How could MAX_HIT be < 1?? */
> 

You got to check if FIGHTING(d->character) exists, before you get some
info like GET_MAX_HIT..

if (FIGHTING(d->character) && GET_MAX_HIT(FIGHTING(d->character)) > 0)
   percent = ... etc...

Hope it helps.


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