Re: [CODE] XapObjs

From: Edward Felch (dustlos@hotmail.com)
Date: 06/22/01


Ok, I've tinkered with the saving/loading of xapobjects with special extra
and/or perm. flags but haven't met with success, here is some more detail:

I know I am doing something wrong, sometimes the last obj_val is corrupted
when I save, quit, 0, and log back on. And when i enchant a long sword for
example, lots of weird things happen with it's extra flags (undefined flags
set, invisible, etc) when it should only set unique save, and the magic
extras. Please spend a minute and look this over... thanks for any
suggestions :)

In db.c: within my_obj_save_to_disk
  fprintf(fp,"#%ld\n"
             "%d %d %d %d %d %d %d %d %ld\n",
             GET_OBJ_VNUM(obj),
             locate,
             GET_OBJ_VAL(obj, 0),
             GET_OBJ_VAL(obj, 1),
             GET_OBJ_VAL(obj, 2),
             GET_OBJ_VAL(obj, 3),
             GET_OBJ_VAL(obj, 4),
             GET_OBJ_VAL(obj, 5),
             GET_OBJ_EXTRA(obj),
             GET_OBJ_PERM(obj));



In db.c: within read_xap_objects
      int t[10];
      long tester = 0;
      int boogle = 0;

      sscanf(line,"%d %d %d %d %d %d %d %ld",t, t+1, t+2, t+3, t+4, t+5,
&boogle, &tester);
      GET_OBJ_VAL(temp,0) = t[1];
      GET_OBJ_VAL(temp,1) = t[2];
      GET_OBJ_VAL(temp,2) = t[3];
      GET_OBJ_VAL(temp,3) = t[4];
      GET_OBJ_VAL(temp,4) = t[5];
      GET_OBJ_VAL(temp,5) = t[6];
      temp->obj_flags.extra_flags = boogle;
      temp->obj_flags.bitvector = tester;

In objsave.c: within Crash_load_xapobjs
      sscanf(line,"%d %d %d %d %d %d %d %ld",t, t + 1, t+2, t+3, t+4, t+5,
&boogle, &tester);
      locate=t[0];
      GET_OBJ_VAL(temp,0) = t[1];
      GET_OBJ_VAL(temp,1) = t[2];
      GET_OBJ_VAL(temp,2) = t[3];
      GET_OBJ_VAL(temp,3) = t[4];
      GET_OBJ_VAL(temp,4) = t[5];
      GET_OBJ_VAL(temp,5) = t[6];
      temp->obj_flags.extra_flags = boogle;
      temp->obj_flags.bitvector = tester;
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
   +---------------------------------------------------------------+
   | 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