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.4 by root, Mon Sep 4 15:51:24 2006 UTC vs.
Revision 1.11 by root, Fri Sep 8 17:14:07 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
555 } 556 }
556 557
557 parse_object (tmp, thawer, map_flags); 558 parse_object (tmp, thawer, map_flags);
558 559
559 if (tmp->arch) 560 if (tmp->arch)
561 {
560 insert_ob_in_ob (tmp, op); 562 // was: insert_ob_in_ob (tmp, op);
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.
566 CLEAR_FLAG (tmp, FLAG_OBJ_ORIGINAL);
567 CLEAR_FLAG (tmp, FLAG_REMOVED);
568
569 if (!op_inv)
570 {
571 op->inv = tmp;
572 tmp->above = 0;
573 }
574 else
575 {
576 while (op_inv->below)
577 op_inv = op_inv->below;
578
579 op_inv->below = tmp;
580 tmp->above = op_inv;
581 }
582
583 tmp->below = 0;
584 tmp->env = op;
585 op_inv = tmp;
586 }
561 else 587 else
562 { 588 {
563 LOG (llevDebug, "Discarding object without arch: %s\n", 589 LOG (llevDebug, "Discarding object without arch: %s\n",
564 tmp->name ? (const char *) tmp->name : "(null)"); 590 tmp->name ? (const char *) tmp->name : "(null)");
565 free_object (tmp); 591 free_object (tmp);
625 op->move_slow |= MOVE_WALK; 651 op->move_slow |= MOVE_WALK;
626 thawer.get (op->move_slow_penalty); 652 thawer.get (op->move_slow_penalty);
627 break; 653 break;
628 654
629 case KW_face: 655 case KW_face:
630 if (const char *str = thawer.get_str ())
631 op->face = &new_faces[FindFace (str, 0)]; 656 op->face = &new_faces[FindFace (thawer.get_str (), 0)];
632 else
633 op->face = 0;
634 break; 657 break;
635 658
636 case KW_x: thawer.get (op->x); break; 659 case KW_x: thawer.get (op->x); break;
637 case KW_y: thawer.get (op->y); break; 660 case KW_y: thawer.get (op->y); break;
638 case KW_Str: // uppercase alias 661 case KW_Str: // uppercase alias
1008 thawer.line += strlen (thawer.line) + 1; 1031 thawer.line += strlen (thawer.line) + 1;
1009 1032
1010 break; 1033 break;
1011 1034
1012 default: 1035 default:
1013 printf ("kw abort %s\n", keyword_str [kw]);//D 1036 LOG (llevError, "UNSUPPORTED KEYWORD IN MAP: \"%s\", bug in normaliser. skipping.\n", keyword_str [kw]);
1014 abort (); 1037 break;
1015 } 1038 }
1016 } 1039 }
1017} 1040}
1018 1041
1019/* 1042/*
1040 * as appropriate in op. 1063 * as appropriate in op.
1041 * 1064 *
1042 * This function appears to be used in only 2 places - in crossedit to 1065 * This function appears to be used in only 2 places - in crossedit to
1043 * override values and in c_wiz to mutate values. 1066 * override values and in c_wiz to mutate values.
1044 */ 1067 */
1068int
1045int set_variable(object *op,char *buf) { 1069set_variable(object *op, char *buf)
1070{
1071 return 0;
1046#if 0 1072#if 0
1047 int retval; 1073 int retval;
1048 object_thawer thawer (0); 1074 object_thawer thawer (0);
1049 1075
1050 strcpy(msgbuf, ""); 1076 strcpy(msgbuf, "");
1107 1133
1108void init_vars() { 1134void init_vars() {
1109} 1135}
1110 1136
1111/* This returns a string of the integer movement type */ 1137/* This returns a string of the integer movement type */
1138#if 0
1139// unused function
1112static char* get_string_move_type(MoveType mt) 1140static char* get_string_move_type(MoveType mt)
1113{ 1141{
1114 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF]; 1142 static char retbuf[MAX_BUF], retbuf_all[MAX_BUF];
1115 int i, all_count=0, count; 1143 int i, all_count=0, count;
1116 1144
1144 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim' 1172 * 'all -walk -fly_low' - it is shorter to return 'fly_high swim'
1145 */ 1173 */
1146 if (all_count <=1) return retbuf_all+1; 1174 if (all_count <=1) return retbuf_all+1;
1147 else return retbuf+1; 1175 else return retbuf+1;
1148} 1176}
1149 1177#endif
1178
1150// compare *op against *tmp and output differences 1179// compare *op against *tmp and output differences
1151void 1180void
1152put (object_freezer &f, object *op, object *tmp) 1181put (object_freezer &f, object *op, object *tmp)
1153{ 1182{
1154 int i; 1183 int i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines