aboutsummaryrefslogtreecommitdiff
path: root/worlds/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'worlds/test.c')
-rw-r--r--worlds/test.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/worlds/test.c b/worlds/test.c
index 2ce4122..722584c 100644
--- a/worlds/test.c
+++ b/worlds/test.c
@@ -115,13 +115,20 @@ void weap_destroy(struct object_t *obj)
obj->userdata = NULL;
}
+void *weap_clone(void *userdata)
+{
+ void *ret = malloc(sizeof(double));
+ memcpy(ret, userdata, sizeof(double));
+ return ret;
+}
+
const struct obj_class_t netcosm_obj_classes[] = {
{ "weapon",
weap_serialize,
weap_deserialize,
NULL,
NULL,
- NULL,
+ weap_clone,
weap_destroy,
shiny },
};