Re: Battle prompt off when (FIGHTING(d->character, POS_MORTALLYW))

From: Todd A Laycock (tlayco1@uic.edu)
Date: 11/29/01


On Thu, 29 Nov 2001, David Cole wrote:

> Hello list,
> Trying to add a few things here to the prompt, mainly what i'm working on
> atm is making the tank name and condition not show when the MOB/PC being
> faught is mortally wounded. But i'm getting some errors in msvc++ 6.0, can
> anyone help?
>
> Here's what I'm doing, bit sloppy, anyone got a better meathod?
>
>  if (FIGHTING(d->character)
>         && GET_POS(FIGHTING(d->character, POS_MORTALLYW))) { /* WARRNING
> C4002 */
>  sprintf(prompt + strlen(prompt), "");
>  } else {
>     if (PRF_FLAGGED(d->character, PRF_TANKNAME) && FIGHTING(d->character)) {
>  if (CAN_SEE(d->character, FIGHTING(d->character))) {
>     sprintf(prompt + strlen(prompt), " T: %s ",
> GET_NAME(FIGHTING(FIGHTING(d->character))));
>  } else
>  sprintf(prompt + strlen(prompt), " T: Someone ");
>  }
> then the condition stuff, bla bla bla
> }
>

Try this:

  if (GET_POS(FIGHTING(d->character)) == POS_MORTALLYW)


> And heres the error:
> C:\circle30bpl17\src\prompt.c(239) : warning C4002: too many actual
> parameters for macro 'FIGHTING'
>

This warning is because FIGHTING takes one parameter (struct char_data *),
and you have two (d->character, POS_MORTALLYW).

> I've tryed GET_POS(FIGHTING(d->character) = POS_MORTALLYW) and it returns
> this:
>
> C:\circle30bpl17\src\prompt.c(240) : warning C4047: '=' : 'struct char_data
> *' differs in levels of indirection from 'const int '

That warning is because of the missing ) and the = inside of the macro
call.  Basically making the macro do an assignment before evaluating the
contents of the ()s.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST