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.1 by root, Sun Sep 3 22:45:55 2006 UTC vs.
Revision 1.4 by root, Mon Sep 4 15:51:24 2006 UTC

509 { 509 {
510 keyword kw = thawer.get_kv (); 510 keyword kw = thawer.get_kv ();
511 511
512 switch (kw) 512 switch (kw)
513 { 513 {
514 case KW_Object: // uppercase alias
514 case KW_object: 515 case KW_object:
515 thawer.get (op->name); 516 thawer.get (op->name);
516 517
517 if (op->arch != NULL) 518 if (op->arch != NULL)
518 op->arch->name = op->name; 519 op->arch->name = op->name;
624 op->move_slow |= MOVE_WALK; 625 op->move_slow |= MOVE_WALK;
625 thawer.get (op->move_slow_penalty); 626 thawer.get (op->move_slow_penalty);
626 break; 627 break;
627 628
628 case KW_face: 629 case KW_face:
630 if (const char *str = thawer.get_str ())
629 op->face = &new_faces[FindFace (thawer.get_str (), 0)]; 631 op->face = &new_faces[FindFace (str, 0)];
632 else
633 op->face = 0;
630 break; 634 break;
631 635
632 case KW_x: thawer.get (op->x); break; 636 case KW_x: thawer.get (op->x); break;
633 case KW_y: thawer.get (op->y); break; 637 case KW_y: thawer.get (op->y); break;
638 case KW_Str: // uppercase alias
634 case KW_str: thawer.get (op->stats.Str); break; 639 case KW_str: thawer.get (op->stats.Str); break;
640 case KW_Dex: // uppercase alias
635 case KW_dex: thawer.get (op->stats.Dex); break; 641 case KW_dex: thawer.get (op->stats.Dex); break;
642 case KW_Con: // uppercase alias
636 case KW_con: thawer.get (op->stats.Con); break; 643 case KW_con: thawer.get (op->stats.Con); break;
644 case KW_Wis: // uppercase alias
637 case KW_wis: thawer.get (op->stats.Wis); break; 645 case KW_wis: thawer.get (op->stats.Wis); break;
646 case KW_Cha: // uppercase alias
638 case KW_cha: thawer.get (op->stats.Cha); break; 647 case KW_cha: thawer.get (op->stats.Cha); break;
648 case KW_Int: // uppercase alias
639 case KW_int: thawer.get (op->stats.Int); break; 649 case KW_int: thawer.get (op->stats.Int); break;
650 case KW_Pow: // uppercase alias
640 case KW_pow: thawer.get (op->stats.Pow); break; 651 case KW_pow: thawer.get (op->stats.Pow); break;
641 case KW_hp: thawer.get (op->stats.hp); break; 652 case KW_hp: thawer.get (op->stats.hp); break;
642 case KW_maxhp: thawer.get (op->stats.maxhp); break; 653 case KW_maxhp: thawer.get (op->stats.maxhp); break;
643 case KW_sp: thawer.get (op->stats.sp); break; 654 case KW_sp: thawer.get (op->stats.sp); break;
644 case KW_maxsp: thawer.get (op->stats.maxsp); break; 655 case KW_maxsp: thawer.get (op->stats.maxsp); break;
965 976
966 case KW_editable: 977 case KW_editable:
967 case KW_editor_folder: 978 case KW_editor_folder:
968 break; 979 break;
969 980
981 case KW_More: // uppercase alias
970 case KW_more: 982 case KW_more:
971 /* We need to record that this is a multipart object, 983 /* We need to record that this is a multipart object,
972 * so the calling function can glue things back together 984 * so the calling function can glue things back together
973 */ 985 */
974 ismore = 1; 986 ismore = 1;
984 996
985 case KW_EOF: 997 case KW_EOF:
986 return LL_EOF; 998 return LL_EOF;
987 999
988 case KW_ERROR: 1000 case KW_ERROR:
989 set_ob_key_value(op, thawer.line, thawer.last_value, true); 1001 set_ob_key_value (op, thawer.line, thawer.last_value, true);
990 //printf ("addkv(%s,%s)\n", thawer.line, thawer.get_str());//D 1002 //printf ("addkv(%s,%s)\n", thawer.line, thawer.get_str());//D
991 1003
992 // skip line, ugly 1004 //TODO: skip line, ugly, factor parsing better
1005 if (thawer.last_value)
1006 thawer.line = thawer.last_value;
1007
993 thawer.line = thawer.last_value + strlen (thawer.last_value) + 1; 1008 thawer.line += strlen (thawer.line) + 1;
1009
994 break; 1010 break;
995 1011
996 default: 1012 default:
997 printf ("kw abort %d\n", kw);//D 1013 printf ("kw abort %s\n", keyword_str [kw]);//D
998 abort (); 1014 abort ();
999 } 1015 }
1000 } 1016 }
1001} 1017}
1002 1018
1129 */ 1145 */
1130 if (all_count <=1) return retbuf_all+1; 1146 if (all_count <=1) return retbuf_all+1;
1131 else return retbuf+1; 1147 else return retbuf+1;
1132} 1148}
1133 1149
1134
1135// compare *op against *tmp and output differences 1150// compare *op against *tmp and output differences
1136void 1151void
1137put (object_freezer &f, object *op, object *tmp) 1152put (object_freezer &f, object *op, object *tmp)
1138{ 1153{
1139 int i; 1154 int i;
1169 if (op->lore != tmp->lore) f.put (KW_lore, KW_endlore, op->lore); 1184 if (op->lore != tmp->lore) f.put (KW_lore, KW_endlore, op->lore);
1170 1185
1171 CMP_OUT (other_arch); 1186 CMP_OUT (other_arch);
1172 CMP_OUT (face); 1187 CMP_OUT (face);
1173 1188
1189 if (!op->face || !op->face->name)
1190 printf ("ERRFACE<%s,%s, face %p,%p, fname%s>\n", &tmp->name, &op->name, tmp->face, op->face, op->face ? &op->face->name : "<noface>");//D
1191
1174 if (op->animation_id != tmp->animation_id) 1192 if (op->animation_id != tmp->animation_id)
1175 if (op->animation_id) 1193 if (op->animation_id)
1176 { 1194 {
1177 f.put (KW_animation, animations[GET_ANIM_ID (op)].name); 1195 f.put (KW_animation, animations[GET_ANIM_ID (op)].name);
1178 1196
1179 if (!QUERY_FLAG (op, FLAG_ANIMATE)) 1197 if (!QUERY_FLAG (op, FLAG_ANIMATE))
1180 f.put (KW_is_animated, 0); 1198 f.put (KW_is_animated, (sint32)0);
1181 } 1199 }
1182 else 1200 else
1183 f.put (KW_animation, "NONE"); 1201 f.put (KW_animation, (const char *)0);
1184 1202
1185 CMP_OUT2 (str , stats.Str); 1203 CMP_OUT2 (str , stats.Str);
1186 CMP_OUT2 (dex , stats.Dex); 1204 CMP_OUT2 (dex , stats.Dex);
1187 CMP_OUT2 (con , stats.Con); 1205 CMP_OUT2 (con , stats.Con);
1188 CMP_OUT2 (wis , stats.Wis); 1206 CMP_OUT2 (wis , stats.Wis);
1272 1290
1273 if (!COMPARE_FLAGS (op, tmp)) 1291 if (!COMPARE_FLAGS (op, tmp))
1274 for (i = 0; i <= NUM_FLAGS; i++) 1292 for (i = 0; i <= NUM_FLAGS; i++)
1275 if (flag_names [i] 1293 if (flag_names [i]
1276 && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i))) 1294 && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i)))
1277 f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : 0); 1295 f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : "0");
1278 1296
1279 /* Save body locations */ 1297 /* Save body locations */
1280 for (i = 0; i < NUM_BODY_LOCATIONS; i++) 1298 for (i = 0; i < NUM_BODY_LOCATIONS; i++)
1281 if (op->body_info[i] != tmp->body_info[i]) 1299 if (op->body_info[i] != tmp->body_info[i])
1282 f.put (body_locations[i].save_name, op->body_info[i]); 1300 f.put (body_locations[i].save_name, op->body_info[i]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines