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.3 by root, Mon Sep 4 13:55:54 2006 UTC

624 op->move_slow |= MOVE_WALK; 624 op->move_slow |= MOVE_WALK;
625 thawer.get (op->move_slow_penalty); 625 thawer.get (op->move_slow_penalty);
626 break; 626 break;
627 627
628 case KW_face: 628 case KW_face:
629 if (const char *str = thawer.get_str ())
629 op->face = &new_faces[FindFace (thawer.get_str (), 0)]; 630 op->face = &new_faces[FindFace (str, 0)];
631 else
632 op->face = 0;
630 break; 633 break;
631 634
632 case KW_x: thawer.get (op->x); break; 635 case KW_x: thawer.get (op->x); break;
633 case KW_y: thawer.get (op->y); break; 636 case KW_y: thawer.get (op->y); break;
634 case KW_str: thawer.get (op->stats.Str); break; 637 case KW_str: thawer.get (op->stats.Str); break;
984 987
985 case KW_EOF: 988 case KW_EOF:
986 return LL_EOF; 989 return LL_EOF;
987 990
988 case KW_ERROR: 991 case KW_ERROR:
989 set_ob_key_value(op, thawer.line, thawer.last_value, true); 992 set_ob_key_value (op, thawer.line, thawer.last_value, true);
990 //printf ("addkv(%s,%s)\n", thawer.line, thawer.get_str());//D 993 //printf ("addkv(%s,%s)\n", thawer.line, thawer.get_str());//D
991 994
992 // skip line, ugly 995 //TODO: skip line, ugly, factor parsing better
996 if (thawer.last_value)
997 thawer.line = thawer.last_value;
998
993 thawer.line = thawer.last_value + strlen (thawer.last_value) + 1; 999 thawer.line += strlen (thawer.line) + 1;
1000
994 break; 1001 break;
995 1002
996 default: 1003 default:
997 printf ("kw abort %d\n", kw);//D 1004 printf ("kw abort %s\n", keyword_str [kw]);//D
998 abort (); 1005 abort ();
999 } 1006 }
1000 } 1007 }
1001} 1008}
1002 1009
1129 */ 1136 */
1130 if (all_count <=1) return retbuf_all+1; 1137 if (all_count <=1) return retbuf_all+1;
1131 else return retbuf+1; 1138 else return retbuf+1;
1132} 1139}
1133 1140
1134
1135// compare *op against *tmp and output differences 1141// compare *op against *tmp and output differences
1136void 1142void
1137put (object_freezer &f, object *op, object *tmp) 1143put (object_freezer &f, object *op, object *tmp)
1138{ 1144{
1139 int i; 1145 int i;
1169 if (op->lore != tmp->lore) f.put (KW_lore, KW_endlore, op->lore); 1175 if (op->lore != tmp->lore) f.put (KW_lore, KW_endlore, op->lore);
1170 1176
1171 CMP_OUT (other_arch); 1177 CMP_OUT (other_arch);
1172 CMP_OUT (face); 1178 CMP_OUT (face);
1173 1179
1180 if (!op->face || !op->face->name)
1181 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
1182
1174 if (op->animation_id != tmp->animation_id) 1183 if (op->animation_id != tmp->animation_id)
1175 if (op->animation_id) 1184 if (op->animation_id)
1176 { 1185 {
1177 f.put (KW_animation, animations[GET_ANIM_ID (op)].name); 1186 f.put (KW_animation, animations[GET_ANIM_ID (op)].name);
1178 1187
1179 if (!QUERY_FLAG (op, FLAG_ANIMATE)) 1188 if (!QUERY_FLAG (op, FLAG_ANIMATE))
1180 f.put (KW_is_animated, 0); 1189 f.put (KW_is_animated, (sint32)0);
1181 } 1190 }
1182 else 1191 else
1183 f.put (KW_animation, "NONE"); 1192 f.put (KW_animation, (const char *)0);
1184 1193
1185 CMP_OUT2 (str , stats.Str); 1194 CMP_OUT2 (str , stats.Str);
1186 CMP_OUT2 (dex , stats.Dex); 1195 CMP_OUT2 (dex , stats.Dex);
1187 CMP_OUT2 (con , stats.Con); 1196 CMP_OUT2 (con , stats.Con);
1188 CMP_OUT2 (wis , stats.Wis); 1197 CMP_OUT2 (wis , stats.Wis);
1272 1281
1273 if (!COMPARE_FLAGS (op, tmp)) 1282 if (!COMPARE_FLAGS (op, tmp))
1274 for (i = 0; i <= NUM_FLAGS; i++) 1283 for (i = 0; i <= NUM_FLAGS; i++)
1275 if (flag_names [i] 1284 if (flag_names [i]
1276 && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i))) 1285 && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i)))
1277 f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : 0); 1286 f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : "0");
1278 1287
1279 /* Save body locations */ 1288 /* Save body locations */
1280 for (i = 0; i < NUM_BODY_LOCATIONS; i++) 1289 for (i = 0; i < NUM_BODY_LOCATIONS; i++)
1281 if (op->body_info[i] != tmp->body_info[i]) 1290 if (op->body_info[i] != tmp->body_info[i])
1282 f.put (body_locations[i].save_name, op->body_info[i]); 1291 f.put (body_locations[i].save_name, op->body_info[i]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines