Class Implementation

From: Stephen Marz (smarz@MAIL.TDS.NET)
Date: 08/07/97


Anyone want to tell me why this class implementation only returns 0? It
will not return any other value. I even made a test define, the
GET_CLASS(mob_proto +i) = NPC_CLASS_UNKNOWN, unknown is number 11 in the
structs.h file.

sscanf(line, "%s %s %d %s %c", f1, f2, t + 2, &race_letter, &letter);
  MOB_FLAGS(mob_proto + i) = asciiflag_conv(f1);
  SET_BIT(MOB_FLAGS(mob_proto + i), MOB_ISNPC);
  AFF_FLAGS(mob_proto + i) = asciiflag_conv(f2);
  GET_ALIGNMENT(mob_proto + i) = t[2];

  LOWER(race_letter);
  GET_CLASS(mob_proto + i) = NPC_CLASS_UNKNOWN;
  switch (race_letter)
  {

  case 'h':
   GET_CLASS(mob_proto + i) = NPC_CLASS_HUMAN;
   break;

  case 'e':
   GET_CLASS(mob_proto + i) = NPC_CLASS_ELF;
   break;

  case 'g':
   GET_CLASS(mob_proto + i) = NPC_CLASS_GNOME;
   break;

  case 'fa':
   GET_CLASS(mob_proto + i) = NPC_CLASS_FAIRY;
   break;

  case 'u':
   GET_CLASS(mob_proto + i) = NPC_CLASS_UNDEAD;
   break;

  case 'k':
   GET_CLASS(mob_proto + i) = NPC_CLASS_UNKNOWN;
   break;

  case 'd':
   GET_CLASS(mob_proto + i) = NPC_CLASS_DRAGON;
   break;

  case 'a':
   GET_CLASS(mob_proto + i) = NPC_CLASS_ANIMAL;
   break;

  case 'gi':
   GET_CLASS(mob_proto + i) = NPC_CLASS_GIANT;
   break;

  case 'm':
   GET_CLASS(mob_proto + i) = NPC_CLASS_MATTER;
   break;

  case 'f':
   GET_CLASS(mob_proto + i) = NPC_CLASS_FORMLESS;
   break;

  case 'ge':
   GET_CLASS(mob_proto + i) = NPC_CLASS_GERM;
   break;

  case 's':
   GET_CLASS(mob_proto + i) = NPC_CLASS_SEA;
   break;

  case 'de':
   GET_CLASS(mob_proto + i) = NPC_CLASS_DEMON;
   break;

  case 'sm':
   GET_CLASS(mob_proto + i) = NPC_CLASS_MONSTER;
   break;
  default:
   GET_CLASS(mob_proto + i) = NPC_CLASS_UNKNOWN;
   break;

  }


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



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