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.20 by root, Tue Nov 7 14:58:35 2006 UTC vs.
Revision 1.23 by root, Fri Dec 15 19:59:19 2006 UTC

26 variable. */ 26 variable. */
27 27
28 28
29#include <global.h> 29#include <global.h>
30#include <loader.h> 30#include <loader.h>
31#include <newserver.h>
32#include <sproto.h> 31#include <sproto.h>
33 32
34/* Maps the MOVE_* values to names */ 33/* Maps the MOVE_* values to names */
35static const char *const move_name[] = { "walk", "fly_low", "fly_high", "swim", "boat", NULL }; 34static const char *const move_name[] = { "walk", "fly_low", "fly_high", "swim", "boat", NULL };
36 35
556 555
557 if (arch != NULL) 556 if (arch != NULL)
558 tmp = arch_to_object (arch); 557 tmp = arch_to_object (arch);
559 else 558 else
560 { 559 {
561 tmp = get_object (); 560 tmp = object::create ();
562 /* record the name of the broken object */ 561 /* record the name of the broken object */
563 tmp->name = str; 562 tmp->name = str;
564 } 563 }
565 564
566 parse_object (tmp, thawer, map_flags); 565 parse_object (tmp, thawer, map_flags);
593 op_inv = tmp; 592 op_inv = tmp;
594 } 593 }
595 else 594 else
596 { 595 {
597 LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)"); 596 LOG (llevDebug, "Discarding object without arch: %s\n", tmp->name ? (const char *) tmp->name : "(null)");
598 free_object (tmp); 597 tmp->destroy ();
599 } 598 }
600 } 599 }
601 else 600 else
602 { 601 {
603 /* This is the actual archetype definition then */ 602 /* This is the actual archetype definition then */
604 op->arch = archetype::find (str); 603 op->arch = archetype::find (str);
605 604
606 if (op->arch != NULL) 605 if (op->arch)
607 copy_object (&op->arch->clone, op); 606 op->arch->clone.copy_to (op);
608 else if (!arch_init) 607 else if (!arch_init)
609 /* record the name of the broken object */ 608 /* record the name of the broken object */
610 op->name = str; 609 op->name = str;
611 } 610 }
612 } 611 }
1303 if (!arch_field || my_field->value != arch_field->value) 1302 if (!arch_field || my_field->value != arch_field->value)
1304 f.put (my_field->key, my_field->value); 1303 f.put (my_field->key, my_field->value);
1305 } 1304 }
1306 1305
1307 /* We don't need to worry about the arch's extra fields - they 1306 /* We don't need to worry about the arch's extra fields - they
1308 * will get taken care of the copy_object function. 1307 * will get taken care of the copy_to method.
1309 */ 1308 */
1310 1309
1311 { 1310 {
1312 char uids[64]; 1311 char uids[64];
1313 snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq); 1312 snprintf (uids, sizeof (uids), "<1.%llx>", (unsigned long long)op->uuid.seq);
1498 save_object (fp, tmp, flag); 1497 save_object (fp, tmp, flag);
1499 old = tmp; 1498 old = tmp;
1500 } 1499 }
1501 1500
1502 if (!(flag & 2)) 1501 if (!(flag & 2))
1503 { 1502 op->destroy ();
1504 remove_ob (op);
1505 free_object (op);
1506 }
1507 1503
1508 fp.put (op); 1504 fp.put (op);
1509 fprintf (fp, "end\n"); 1505 fprintf (fp, "end\n");
1510} 1506}
1511 1507

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines