ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/loader.C
(Generate patch)

Comparing deliantra/server/common/loader.C (file contents):
Revision 1.7 by root, Mon Sep 4 17:34:50 2006 UTC vs.
Revision 1.9 by root, Thu Sep 7 14:21:04 2006 UTC

499 if (thawer.get_sint32 ()) \ 499 if (thawer.get_sint32 ()) \
500 SET_FLAG (op, flag); \ 500 SET_FLAG (op, flag); \
501 else \ 501 else \
502 CLEAR_FLAG (op, flag) \ 502 CLEAR_FLAG (op, flag) \
503 503
504int parse_object (object * op, object_thawer & thawer, int map_flags) 504int parse_object (object *op, object_thawer &thawer, int map_flags)
505{ 505{
506 bool ismore = 0; 506 bool ismore = 0;
507 object *op_inv = op->inv;
507 508
508 for (;;) 509 for (;;)
509 { 510 {
510 keyword kw = thawer.get_kv (); 511 keyword kw = thawer.get_kv ();
511 512
558 559
559 if (tmp->arch) 560 if (tmp->arch)
560 { 561 {
561 // was: insert_ob_in_ob (tmp, op); 562 // was: insert_ob_in_ob (tmp, op);
562 // but manually adding it can improve map loading times a lot 563 // but manually adding it can improve map loading times a lot
564 // also, appending instead of prepending keeps the
565 // save ordering the same between repeated load/saves.
563 CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL); 566 CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL);
564 CLEAR_FLAG (tmp, FLAG_REMOVED); 567 CLEAR_FLAG (tmp, FLAG_REMOVED);
565 tmp->env = op;
566 568
567 if (!op->inv) 569 if (!op_inv)
570 {
568 op->inv = tmp; 571 op->inv = tmp;
572 tmp->above = 0;
573 }
569 else 574 else
570 { 575 {
576 while (op_inv->below)
577 op_inv = op_inv->below;
578
579 op_inv->below = tmp;
571 tmp->below = op->inv; 580 tmp->above = op_inv;
572 tmp->below->above = tmp;
573 op->inv = tmp;
574 } 581 }
582
583 tmp->below = 0;
584 tmp->env = op;
585 op_inv = tmp;
575 } 586 }
576 else 587 else
577 { 588 {
578 LOG (llevDebug, "Discarding object without arch: %s\n", 589 LOG (llevDebug, "Discarding object without arch: %s\n",
579 tmp->name ? (const char *) tmp->name : "(null)"); 590 tmp->name ? (const char *) tmp->name : "(null)");
1055 * as appropriate in op. 1066 * as appropriate in op.
1056 * 1067 *
1057 * This function appears to be used in only 2 places - in crossedit to 1068 * This function appears to be used in only 2 places - in crossedit to
1058 * override values and in c_wiz to mutate values. 1069 * override values and in c_wiz to mutate values.
1059 */ 1070 */
1071int
1060int set_variable(object *op,char *buf) { 1072set_variable(object *op, char *buf)
1073{
1074 return 0;
1061#if 0 1075#if 0
1062 int retval; 1076 int retval;
1063 object_thawer thawer (0); 1077 object_thawer thawer (0);
1064 1078
1065 strcpy(msgbuf, ""); 1079 strcpy(msgbuf, "");
1122 1136
1123void init_vars() { 1137void init_vars() {
1124} 1138}
1125 1139
1126/* This returns a string of the integer movement type */ 1140/* This returns a string of the integer movement type */
1141#if 0
1142// unused function
1127static char* get_string_move_type(MoveType mt) 1143static char* get_string_move_type(MoveType mt)
1128{ 1144{
1129 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF]; 1145 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF];
1130 int i, all_count=0, count; 1146 int i, all_count=0, count;
1131 1147
1159 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' 1175 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim'
1160 */ 1176 */
1161 if (all_count <=1) return retbuf_all+1; 1177 if (all_count <=1) return retbuf_all+1;
1162 else return retbuf+1; 1178 else return retbuf+1;
1163} 1179}
1164 1180#endif
1181
1165// compare *op against *tmp and output differences 1182// compare *op against *tmp and output differences
1166void 1183void
1167put (object_freezer &f, object *op, object *tmp) 1184put (object_freezer &f, object *op, object *tmp)
1168{ 1185{
1169 int i; 1186 int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines