1 | /* |
1 | /* |
2 | * static char *rcsid_object_h = |
2 | * static char *rcsid_object_h = |
3 | * "$Id: object.h,v 1.8 2006/08/27 16:15:12 root Exp $"; |
3 | * "$Id: object.h,v 1.10 2006/08/28 16:52:51 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 | |
… | |
… | |
99 | * related ones, etc. |
99 | * related ones, etc. |
100 | * This structure is best viewed with about a 100 width screen. |
100 | * This structure is best viewed with about a 100 width screen. |
101 | * MSW 2002-07-05 |
101 | * MSW 2002-07-05 |
102 | */ |
102 | */ |
103 | |
103 | |
104 | struct object_simple : extendable<object> { |
104 | struct object_simple : attachable<object> { |
105 | static data_type get_dt () { return DT_OBJECT; } |
105 | static data_type get_dt () { return DT_OBJECT; } |
106 | |
106 | |
107 | /* These variables are not changed by copy_object() */ |
107 | /* These variables are not changed by copy_object() */ |
108 | struct pl *contr; /* Pointer to the player which control this object */ |
108 | struct pl *contr; /* Pointer to the player which control this object */ |
109 | struct object *next; /* Pointer to the next object in the free/used list */ |
109 | struct object *next; /* Pointer to the next object in the free/used list */ |
… | |
… | |
258 | const char *custom_name; /* Custom name assigned by player */ |
258 | const char *custom_name; /* Custom name assigned by player */ |
259 | key_value *key_values; /* Fields not explictly known by the loader. */ |
259 | key_value *key_values; /* Fields not explictly known by the loader. */ |
260 | }; |
260 | }; |
261 | |
261 | |
262 | struct object : object_special, object_simple { |
262 | struct object : object_special, object_simple { |
263 | void instantiate_ (); |
|
|
264 | void instantiate () |
|
|
265 | { |
|
|
266 | if (attach) |
|
|
267 | { |
|
|
268 | instantiate_ (); |
|
|
269 | free_string (attach); |
|
|
270 | attach = 0; |
|
|
271 | } |
|
|
272 | } |
|
|
273 | void clone (object *destination) |
263 | void clone (object *destination) |
274 | { |
264 | { |
275 | if (attach) |
265 | if (attach) |
276 | destination->attach = add_refcount (attach); |
266 | destination->attach = add_refcount (attach); |
277 | |
267 | |