--- deliantra/server/common/player.C 2007/01/08 18:18:35 1.15 +++ deliantra/server/common/player.C 2007/01/08 19:25:52 1.16 @@ -147,6 +147,9 @@ pl->savebed_map = first_map_path; + /* this loads the standard objects values. */ + pl->set_object (object::create ()); + /* Loop through the file, loading the rest of the values */ for (;;) { @@ -156,7 +159,8 @@ { case KW_EOF: LOG (llevError, "%s: unexpected EOF while reading player header\n", thawer.name); - delete pl; + pl->ob->destroy (); + pl->destroy (); return 0; case KW_ERROR: @@ -222,11 +226,11 @@ for (int i = 1; i <= count; i++) { - char line[128]; + char line [32]; - fgets (line, 128, thawer); pl->levhp [i] = atoi (line); - fgets (line, 128, thawer); pl->levsp [i] = atoi (line); - fgets (line, 128, thawer); pl->levgrace[i] = atoi (line); + fgets (line, 32, thawer); pl->levhp [i] = atoi (line); + fgets (line, 32, thawer); pl->levsp [i] = atoi (line); + fgets (line, 32, thawer); pl->levgrace[i] = atoi (line); } } break; @@ -238,13 +242,10 @@ } done: - /* this loads the standard objects values. */ - pl->set_object (object::create ()); - if (!load_object (thawer, pl->ob, 0)) { pl->ob->destroy (); - delete pl; + pl->destroy (); return 0; }