Re: [CODE] Buffer problem?

From: Alex (ahdecker@home.net)
Date: 04/29/01


Regards again,

Ok, in an attempt to narrow this problem down, I chopped up the medit output
into several smaller chunks; here was the result:
(heh, ignore the grammar for now :P)
The truly bizairre thing is, if I change the L-desc, options C through H
appear,
even though they are seperated by an entire output job.

Any ideas would be greatly appreciated, and I apologize for the length.

-Alex

500H 118V 1X 999C Exits:NES(D)> medit 3415
-- Mob Number:  [3415]
1) Sex: Male             2) Alias: soldier elite gadar xyz
3) S-Desc: a soldier of gadar
4) L-Desc:-
An elite soldier of gadar is patroling here.
5) D-Desc:-
This elite warrior watches the castle's rutinity day by day.  His job is to
make order between these castle walls.  You can tell by the look on his face
that he takes his job seriously.  He looks at you with a suspicious
grin,nodded, then continue his patrol.
6) Level:       [   0],  7) Alignment:    [   0]
8) Hitroll:     [   0],  9) Damroll:      [   0]
A) NumDamDice:  [   1],  B) SizeDamDice:  [   1]
I) Position  : standing
J) Default   : standing
K) Attack    : hit
L) NPC Flags : ISNPC AWARE HELPER
M) AFF Flags : NOBITS
S) Script    : Not Set.
Q) Quit
Enter choice :

Here is my revised menu func:

void medit_disp_menu(struct descriptor_data *d)
{
  struct char_data *mob;

  mob = OLC_MOB(d);
  get_char_cols(d->character);

  sprintf(buf,
#if defined(CLEAR_SCREEN)
" [H [J"
#endif
          "-- Mob Number:  [%s%d%s]\r\n"
          "%s1%s) Sex: %s%-7.7s%s                %s2%s) Alias: %s%s\r\n"
          "%s3%s) S-Desc: %s%s\r\n"
          "%s4%s) L-Desc:-\r\n%s%s"
          "%s5%s) D-Desc:-\r\n%s%s"
        "%s6%s) Level:       [%s%4d%s],  %s7%s) Alignment:
[%s%4d%s]\r\n",
          cyn, OLC_NUM(d), nrm,
          grn, nrm, yel, genders[(int)GET_SEX(mob)], nrm,
          grn, nrm, yel, GET_ALIAS(mob),
          grn, nrm, yel, GET_SDESC(mob),
          grn, nrm, yel, GET_LDESC(mob),
          grn, nrm, yel, GET_DDESC(mob),
          grn, nrm, cyn, GET_LEVEL(mob), nrm,
          grn, nrm, cyn, GET_ALIGNMENT(mob), nrm);
  send_to_char(buf, d->character);
  sprintf(buf,
     "%s8%s) Hitroll:     [%s%4d%s],  %s9%s) Damroll:      [%s%4d%s]\r\n"
     "%sA%s) NumDamDice:  [%s%4d%s],  %sB%s) SizeDamDice:  [%s%4d%s]\r\n",
          grn, nrm, cyn, GET_HITROLL(mob), nrm,
          grn, nrm, cyn, GET_DAMROLL(mob), nrm,
          grn, nrm, cyn, GET_NDD(mob), nrm,
          grn, nrm, cyn, GET_SDD(mob), nrm);
  send_to_char(buf, d->character);
  sprintf(buf,
          "%sC%s) Num HP Dice: [%s%4d%s],  %sD%s) Size HP Dice: [%s%4d%s],  %sE%s)
HP Bonus: [%s%5d%s]\r\n"
          "%sF%s) Armor Class: [%s%4d%s],  %sG%s) Exp:     [%s%9d%s],  %sH%s)
Steel:  [%s%8d%s]\r\n",

          grn, nrm, cyn, GET_HIT(mob), nrm,
          grn, nrm, cyn, GET_MANA(mob), nrm,
          grn, nrm, cyn, GET_MOVE(mob), nrm,
          grn, nrm, cyn, GET_AC(mob), nrm,
          grn, nrm, cyn, GET_EXP(mob), nrm,
          grn, nrm, cyn, GET_GOLD(mob), nrm
          );
  send_to_char(buf, d->character);

  sprintbitarray(MOB_FLAGS(mob), action_bits, PM_ARRAY_MAX, buf1);
  sprintbitarray(AFF_FLAGS(mob), affected_bits, AF_ARRAY_MAX, buf2);
  sprintf(buf,
          "%sI%s) Position  : %s%s\r\n"
          "%sJ%s) Default   : %s%s\r\n"
          "%sK%s) Attack    : %s%s\r\n"
          "%sL%s) NPC Flags : %s%s\r\n"
          "%sM%s) AFF Flags : %s%s\r\n"
#if defined(OASIS_MPROG)
          "%sP%s) Mob Progs : %s%s\r\n"
#endif
        "%sS%s) Script    : %s%s\r\n"
          "%sQ%s) Quit\r\n"
          "Enter choice : ",

          grn, nrm, yel, position_types[(int)GET_POS(mob)],
          grn, nrm, yel, position_types[(int)GET_DEFAULT_POS(mob)],
          grn, nrm, yel, attack_hit_text[GET_ATTACK(mob)].singular,
          grn, nrm, cyn, buf1,
          grn, nrm, cyn, buf2,
#if defined(OASIS_MPROG)
          grn, nrm, cyn, (OLC_MPROGL(d) ? "Set." : "Not Set."),
#endif
          grn, nrm, cyn, mob->proto_script?"Set.":"Not Set.",
          grn, nrm
          );
  send_to_char(buf, d->character);

  OLC_MODE(d) = MEDIT_MAIN_MENU;
}

--
   +---------------------------------------------------------------+
   | 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/05/01 PST