--- deliantra/server/common/loader.C 2006/09/03 22:45:55 1.1 +++ deliantra/server/common/loader.C 2006/09/04 13:55:54 1.3 @@ -626,7 +626,10 @@ break; case KW_face: - op->face = &new_faces[FindFace (thawer.get_str (), 0)]; + if (const char *str = thawer.get_str ()) + op->face = &new_faces[FindFace (str, 0)]; + else + op->face = 0; break; case KW_x: thawer.get (op->x); break; @@ -986,15 +989,19 @@ return LL_EOF; case KW_ERROR: - set_ob_key_value(op, thawer.line, thawer.last_value, true); + set_ob_key_value (op, thawer.line, thawer.last_value, true); //printf ("addkv(%s,%s)\n", thawer.line, thawer.get_str());//D - // skip line, ugly - thawer.line = thawer.last_value + strlen (thawer.last_value) + 1; + //TODO: skip line, ugly, factor parsing better + if (thawer.last_value) + thawer.line = thawer.last_value; + + thawer.line += strlen (thawer.line) + 1; + break; default: - printf ("kw abort %d\n", kw);//D + printf ("kw abort %s\n", keyword_str [kw]);//D abort (); } } @@ -1131,7 +1138,6 @@ else return retbuf+1; } - // compare *op against *tmp and output differences void put (object_freezer &f, object *op, object *tmp) @@ -1171,16 +1177,19 @@ CMP_OUT (other_arch); CMP_OUT (face); + if (!op->face || !op->face->name) + printf ("ERRFACE<%s,%s, face %p,%p, fname%s>\n", &tmp->name, &op->name, tmp->face, op->face, op->face ? &op->face->name : "");//D + if (op->animation_id != tmp->animation_id) if (op->animation_id) { f.put (KW_animation, animations[GET_ANIM_ID (op)].name); if (!QUERY_FLAG (op, FLAG_ANIMATE)) - f.put (KW_is_animated, 0); + f.put (KW_is_animated, (sint32)0); } else - f.put (KW_animation, "NONE"); + f.put (KW_animation, (const char *)0); CMP_OUT2 (str , stats.Str); CMP_OUT2 (dex , stats.Dex); @@ -1274,7 +1283,7 @@ for (i = 0; i <= NUM_FLAGS; i++) if (flag_names [i] && (QUERY_FLAG (op, i) != QUERY_FLAG (tmp, i))) - f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : 0); + f.put (flag_names [i], QUERY_FLAG (op, i) ? "1" : "0"); /* Save body locations */ for (i = 0; i < NUM_BODY_LOCATIONS; i++)