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.5 by root, Mon Sep 4 16:46:32 2006 UTC vs.
Revision 1.10 by root, Fri Sep 8 16:51:42 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
557 parse_object (tmp, thawer, map_flags); 558 parse_object (tmp, thawer, map_flags);
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 addint it can improve map loading times a lot 563 // but manually adding it can improve map loading times a lot
563 tmp->env = op; 564 // also, appending instead of prepending keeps the
565 // save ordering the same between repeated load/saves.
566 CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL);
567 CLEAR_FLAG (tmp, FLAG_REMOVED);
564 568
565 if (!op->inv) 569 if (!op_inv)
570 {
566 op->inv = tmp; 571 op->inv = tmp;
572 tmp->above = 0;
573 }
567 else 574 else
568 { 575 {
576 while (op_inv->below)
577 op_inv = op_inv->below;
578
579 op_inv->below = tmp;
569 tmp->below = op->inv; 580 tmp->above = op_inv;
570 tmp->below->above = tmp;
571 op->inv = tmp;
572 } 581 }
582
583 tmp->below = 0;
584 tmp->env = op;
585 op_inv = tmp;
573 } 586 }
574 else 587 else
575 { 588 {
576 LOG (llevDebug, "Discarding object without arch: %s\n", 589 LOG (llevDebug, "Discarding object without arch: %s\n",
577 tmp->name ? (const char *) tmp->name : "(null)"); 590 tmp->name ? (const char *) tmp->name : "(null)");
638 op->move_slow |= MOVE_WALK; 651 op->move_slow |= MOVE_WALK;
639 thawer.get (op->move_slow_penalty); 652 thawer.get (op->move_slow_penalty);
640 break; 653 break;
641 654
642 case KW_face: 655 case KW_face:
643 if (const char *str = thawer.get_str ())
644 op->face = &new_faces[FindFace (str, 0)]; 656 op->face = &new_faces[FindFace (thawer.get_str (), 0)];
645 else
646 op->face = 0;
647 break;
648 657
649 case KW_x: thawer.get (op->x); break; 658 case KW_x: thawer.get (op->x); break;
650 case KW_y: thawer.get (op->y); break; 659 case KW_y: thawer.get (op->y); break;
651 case KW_Str: // uppercase alias 660 case KW_Str: // uppercase alias
652 case KW_str: thawer.get (op->stats.Str); break; 661 case KW_str: thawer.get (op->stats.Str); break;
1021 thawer.line += strlen (thawer.line) + 1; 1030 thawer.line += strlen (thawer.line) + 1;
1022 1031
1023 break; 1032 break;
1024 1033
1025 default: 1034 default:
1026 printf ("kw abort %s\n", keyword_str [kw]);//D 1035 LOG (llevError, "UNSUPPORTED KEYWORD IN MAP: \"%s\", bug in normaliser. skipping.\n", keyword_str [kw]);
1027 abort (); 1036 break;
1028 } 1037 }
1029 } 1038 }
1030} 1039}
1031 1040
1032/* 1041/*
1053 * as appropriate in op. 1062 * as appropriate in op.
1054 * 1063 *
1055 * This function appears to be used in only 2 places - in crossedit to 1064 * This function appears to be used in only 2 places - in crossedit to
1056 * override values and in c_wiz to mutate values. 1065 * override values and in c_wiz to mutate values.
1057 */ 1066 */
1067int
1058int set_variable(object *op,char *buf) { 1068set_variable(object *op, char *buf)
1069{
1070 return 0;
1059#if 0 1071#if 0
1060 int retval; 1072 int retval;
1061 object_thawer thawer (0); 1073 object_thawer thawer (0);
1062 1074
1063 strcpy(msgbuf, ""); 1075 strcpy(msgbuf, "");
1120 1132
1121void init_vars() { 1133void init_vars() {
1122} 1134}
1123 1135
1124/* This returns a string of the integer movement type */ 1136/* This returns a string of the integer movement type */
1137#if 0
1138// unused function
1125static char* get_string_move_type(MoveType mt) 1139static char* get_string_move_type(MoveType mt)
1126{ 1140{
1127 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF]; 1141 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF];
1128 int i, all_count=0, count; 1142 int i, all_count=0, count;
1129 1143
1157 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' 1171 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim'
1158 */ 1172 */
1159 if (all_count <=1) return retbuf_all+1; 1173 if (all_count <=1) return retbuf_all+1;
1160 else return retbuf+1; 1174 else return retbuf+1;
1161} 1175}
1162 1176#endif
1177
1163// compare *op against *tmp and output differences 1178// compare *op against *tmp and output differences
1164void 1179void
1165put (object_freezer &f, object *op, object *tmp) 1180put (object_freezer &f, object *op, object *tmp)
1166{ 1181{
1167 int i; 1182 int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines