I'm trying to add level restrictions in my code, all by myself. I'm using what I learned from adding object damage in quite some time ago. I've got it coded in where it loads in a default value of "0" into the level slot. I can edit the level slot in OLC (oedit), and it saves to the 3rd numeric line, 4th slot, just like I want. however, the trick is, when I reboot, even though the number is correctly in the *.obj file, it doesn't load it into the level slot for that item. I'm assuming db.c does all the loading in of values pulled from *.obj, so here's the code section I changed around. I'm still a novice, so go easy on my obviously crummy code... =) t[6] is the thing to look for, and obj_flags.level is the one I'm working on. db.c: if (!get_line(obj_f, line) || (retval = sscanf(line, "%d %d %d %d %d %d", t, t + 1, t + 2, t + 3, t + 4, t + 5)) != 6) { fprintf(stderr, "Format error in second numeric line (expecting 6 args, got %d), %s\n", retval, buf2); exit(1); } obj_proto[i].obj_flags.value[0] = t[0]; obj_proto[i].obj_flags.value[1] = t[1]; obj_proto[i].obj_flags.value[2] = t[2]; obj_proto[i].obj_flags.value[3] = t[3]; if (t[4] < 0 || t[4] > 100) { obj_proto[i].obj_flags.curr_slots = 0; obj_proto[i].obj_flags.total_slots = 0; } else { obj_proto[i].obj_flags.curr_slots = t[4]; obj_proto[i].obj_flags.total_slots = t[5]; } if (t[5] < 0 || t[5] > 100) { obj_proto[i].obj_flags.curr_slots = 0; obj_proto[i].obj_flags.total_slots = 0; } else { obj_proto[i].obj_flags.curr_slots = t[4]; obj_proto[i].obj_flags.total_slots = t[5]; } if (!get_line(obj_f, line) || (retval = sscanf(line, "%d %d %d %d", t, t + 1, t + 2, t + 3)) == (3 || 4)) { fprintf(stderr, "SYSERR: Format error in third numeric line (expecting 3 or 4 args, got %d), %s\n", retval, buf2); exit(1); } obj_proto[i].obj_flags.weight = t[0]; obj_proto[i].obj_flags.cost = t[1]; obj_proto[i].obj_flags.cost_per_day = t[2]; if (t[6] < 0 || t[6] > 100) { obj_proto[i].obj_flags.level = 0; } else { obj_proto[i].obj_flags.level = t[6]; } ------------------------------------------ I'm pretty sure it has something to do with using t[6], but I'm stumped... Everything works but loading back once I reboot.... Thanks for any help! -brian +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST