[CODE][NEWBIE][EXP_TABLE]Need some help with my code

From: Lewis, Jason (JLewis@birch.com)
Date: 01/19/01


I am trying to get rid of the exp tables during my cleanup phase of the code
and I have looked at one that was on the snippets page and come up with the
following but cannot make it work.

int exp_to_level(struct char_data *ch)
{
  int modifier, exp;

  if (GET_LEVEL(ch) < 10)
    modifier = 1;
  else if (GET_LEVEL(ch) < 20)
    modifier = 2;
  else if (GET_LEVEL(ch) < 30)
    modifier = 5;
  else if (GET_LEVEL(ch) < 40)
    modifier = 10;
  else if (GET_LEVEL(ch) < 50)
    modifier = 20;
  else if (GET_LEVEL(ch) < 60)
    modifier = 30;
  else if (GET_LEVEL(ch) < 66)
    modifier = 150;
  else
    modifier = 250;


  float class_exp_mod[NUM_CLASSES]= {
          /*       Cle  Thi  War  Ber  Pal  A-P  Ran  Mon  Bar  Dru  Ill
Inv  Enc  Con  Nec  Ass  Sha     */
 /*modifier*/     {1.8, 2.1, 2.4, 2.3, 2.0, 2.0, 1.8, 1.9, 1.9, 1.8, 1.5,
1.5, 1.6, 1.5, 1.7, 2.0, 1.9},
};


  exp = GET_LEVEL(ch) * modifier  * class_exp_mod[(int)GET_CLASS(ch)] *
2500;


return exp;

}

I made all the changes it says to in the original snippet and I am thinking
it may have to do with my array. Can anyone just glancing at this see any
problems with it?


TIA,

Jason Lewis

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