Ok the below is just to show you how things are being processed, as of so far I have commented out the prev line due mainly to the fact I get some errors in db.c. However despite that fact I am almost positive it occurs with or without the isolation of the assignment to prev. Anyways, I have thrown in extra log checks one at the very body of the "Trains") { comparison/function. I have checked both the values of numbers[0-3] and the new_train->spell_number/percent/cost/qp_cost... Everything checks out perfect on boot up, however if I try accessing and or outputting any of those values whether in do_stat_char, (for mob of course), medit or what not... It crashes on the spot. I can't figure out why it's doing that when I am trying to grab that values in the structure. Can anyone see anything wrong with the below? db.c: CASE("Trains") { int numbers[4]; sscanf(value, "%d %d %d %d", numbers, numbers+1, numbers+2, numbers+3) != 4 CREATE(new_train, struct trainer_data, 1); new_train->next = mob_proto[i].mob_specials.trainer; mob_proto[i].mob_specials.trainer->prev = new_train; new_train->prev = NULL; mob_proto[i].mob_specials.trainer = new_train; if(numbers[0] >= 1 && numbers[0] <= (MAX_SKILLS)) new_train->spell_number = numbers[0]; else log("Error in processing trainer spell number."); if(numbers[1] >= 1 && numbers[1] <= 100) new_train->percent = numbers[1]; else log("Error in processing trainer percent value."); if(numbers[2] >= 0) new_train->cost = numbers[2]; else log("Negative value found in cost of trainer spell/skill!"); if(numbers[3] >= 0) new_train->qp_cost = numbers[3]; else log("Negative value found in quest point cost of trainer skills."); } ------------------- structs.h: struct trainer_data { int spell_number; int percent; int cost; int qp_cost; struct trainer_data *next; struct trainer_data *prev; }; -------------------- mob_special_data: struct mob_special_data { .... struct trainer_data *trainer; struct trainer_data train_skills; }; -------------------- genmob.c: #define TRAINER(mob) (mob)->mob_specials.train_skills Thanks Bill. -- +---------------------------------------------------------------+ | 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/04/01 PST