1 | /* |
1 | /* |
2 | * static char *rcsid_arch_c = |
2 | * static char *rcsid_arch_c = |
3 | * "$Id: arch.C,v 1.1 2006/08/13 17:16:00 elmex Exp $"; |
3 | * "$Id: arch.C,v 1.3 2006/08/26 23:36:28 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
28 | |
28 | |
29 | #include <global.h> |
29 | #include <global.h> |
30 | #include <arch.h> |
30 | #include <arch.h> |
31 | #include <funcpoint.h> |
31 | #include <funcpoint.h> |
32 | #include <loader.h> |
32 | #include <loader.h> |
|
|
33 | |
|
|
34 | #include <cassert> |
33 | |
35 | |
34 | /* IF set, does a little timing on the archetype load. */ |
36 | /* IF set, does a little timing on the archetype load. */ |
35 | #define TIME_ARCH_LOAD 0 |
37 | #define TIME_ARCH_LOAD 0 |
36 | |
38 | |
37 | static void add_arch(archetype *at); |
39 | static void add_arch(archetype *at); |
… | |
… | |
591 | LOG(llevError,"Couldn't find archetype.\n"); |
593 | LOG(llevError,"Couldn't find archetype.\n"); |
592 | return NULL; |
594 | return NULL; |
593 | } |
595 | } |
594 | op=get_object(); |
596 | op=get_object(); |
595 | copy_object(&at->clone,op); |
597 | copy_object(&at->clone,op); |
|
|
598 | op->instantiate (); |
596 | op->arch=at; |
599 | op->arch=at; |
597 | return op; |
600 | return op; |
598 | } |
601 | } |
599 | |
602 | |
600 | /* |
603 | /* |
… | |
… | |
729 | LOG(llevError,"Can't clone archetype %d\n",type); |
732 | LOG(llevError,"Can't clone archetype %d\n",type); |
730 | free_object(op); |
733 | free_object(op); |
731 | return NULL; |
734 | return NULL; |
732 | } |
735 | } |
733 | copy_object(&at->clone,op); |
736 | copy_object(&at->clone,op); |
|
|
737 | op->instantiate (); |
734 | return op; |
738 | return op; |
735 | } |
739 | } |
736 | |
740 | |
737 | /* |
741 | /* |
738 | * member: make instance from class |
742 | * member: make instance from class |