--- deliantra/server/common/loader.C 2006/09/04 16:46:32 1.5 +++ deliantra/server/common/loader.C 2006/09/07 14:21:04 1.9 @@ -501,9 +501,10 @@ else \ CLEAR_FLAG (op, flag) \ -int parse_object (object * op, object_thawer & thawer, int map_flags) +int parse_object (object *op, object_thawer &thawer, int map_flags) { bool ismore = 0; + object *op_inv = op->inv; for (;;) { @@ -559,17 +560,29 @@ if (tmp->arch) { // was: insert_ob_in_ob (tmp, op); - // but manually addint it can improve map loading times a lot - tmp->env = op; + // but manually adding it can improve map loading times a lot + // also, appending instead of prepending keeps the + // save ordering the same between repeated load/saves. + CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL); + CLEAR_FLAG (tmp, FLAG_REMOVED); - if (!op->inv) - op->inv = tmp; - else + if (!op_inv) { - tmp->below = op->inv; - tmp->below->above = tmp; op->inv = tmp; + tmp->above = 0; + } + else + { + while (op_inv->below) + op_inv = op_inv->below; + + op_inv->below = tmp; + tmp->above = op_inv; } + + tmp->below = 0; + tmp->env = op; + op_inv = tmp; } else { @@ -1023,8 +1036,8 @@ break; default: - printf ("kw abort %s\n", keyword_str [kw]);//D - abort (); + LOG (llevError, "UNSUPPORTED KEYWORD IN MAP: \"%s\", bug in normaliser. skipping.\n", keyword_str [kw]); + break; } } } @@ -1055,7 +1068,10 @@ * This function appears to be used in only 2 places - in crossedit to * override values and in c_wiz to mutate values. */ -int set_variable(object *op,char *buf) { +int +set_variable(object *op, char *buf) +{ + return 0; #if 0 int retval; object_thawer thawer (0); @@ -1122,6 +1138,8 @@ } /* This returns a string of the integer movement type */ +#if 0 +// unused function static char* get_string_move_type(MoveType mt) { static char retbuf[MAX_BUF], retbuf_all[MAX_BUF]; @@ -1159,7 +1177,8 @@ if (all_count <=1) return retbuf_all+1; else return retbuf+1; } - +#endif + // compare *op against *tmp and output differences void put (object_freezer &f, object *op, object *tmp)