[LONG][CODE][NEWBIE]Help with object table

From: Peter d (death_comes_to_all@hotmail.com)
Date: 08/23/02


Hi!
i asked before with help making an object table..
i have made some progress since then.. but i am far from done with it as i
wish..
this is the code i have written so far.. but i need help with a small
problem. first the code, then the problem..

this is the function that will change min level after the applies you add to
the weapon..

int change_level_for_stats(struct descriptor_data *d)
{
        int min_lev = 0, i;

   for (i = 0; i < MAX_OBJ_AFFECT; i++)
        {
                if ((OLC_OBJ(d)->affected[i].location == APPLY_DAMROLL) &&
(OLC_OBJ(d)->affected[i].modifier != 0))
        min_lev += OLC_OBJ(d)->affected[i].modifier * 40;
   }
   return min_lev;
}

i only added damroll change to test the function.

case 'd':
    case 'D':
      oedit_disp_prompt_apply_menu(d);
      GET_OBJ_LEVEL(OLC_OBJ(d)) = change_level_for_stats(d);
      break;

this is what the main menu option for applies looks like..

my problem is that it doesn't change level the first time i add damroll to
the item.. but it somehow adds 40 levels to the item when i remove or add
damroll afterwards.. what have i done wrong? can anyone help me online or
off the list..
Thanx..

_________________________________________________________________
Med MSN Foto kan du enkelt dela med dig av dina fotografier och beställa
kopior: http://photos.msn.se

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT