+ char * f_name = "add_to_struct_list()";
+ struct NextAndId * nai = try_malloc(n_size, f_name);
+ memset(nai, 0, n_size);
+ nai->id = (start_id<=id && id<=UINT8_MAX) ? id : get_unused_id(struct_id);
+ struct NextAndId ** nai_ptr_ptr = start;
+ for (; NULL != * nai_ptr_ptr; nai_ptr_ptr = &(*nai_ptr_ptr)->next);
+ *nai_ptr_ptr = nai;
+ return nai;
+}
+
+
+
+extern struct ThingAction * add_thing_action(int16_t id)
+{
+ struct ThingAction * ta;
+ ta = (struct ThingAction *) add_to_struct_list(sizeof(struct ThingAction),
+ 1, id, 2,
+ (struct NextAndId **)
+ &world.thing_actions);
+ set_cleanup_flag(CLEANUP_THING_ACTIONS);
+ ta->name = strdup(s[S_CMD_WAIT]);
+ ta->effort = 1;
+ ta->func = actor_wait;
+ return ta;
+}
+
+
+
+extern struct ThingType * add_thing_type(int16_t id)
+{
+ struct ThingType * tt;
+ tt = (struct ThingType *) add_to_struct_list(sizeof(struct ThingType),
+ 0, id, 1,
+ (struct NextAndId **)
+ &world.thing_types);
+ set_cleanup_flag(CLEANUP_THING_TYPES);
+ tt->name = strdup("(none)");
+ return tt;
+}
+
+
+
+extern struct Thing * add_thing(int16_t id, uint8_t type, uint8_t y, uint8_t x)
+{
+ struct Thing * t;
+ t = (struct Thing *) add_to_struct_list(sizeof(struct Thing), 0, id, 0,
+ (struct NextAndId **)&world.things);
+ struct ThingType * tt = get_thing_type(type);
+ set_cleanup_flag(CLEANUP_THINGS);
+ t->type = tt->id;
+ t->lifepoints = tt->lifepoints;
+ t->pos.y = y;
+ t->pos.x = x;
+ return t;
+}
+
+
+
+extern void free_thing_actions(struct ThingAction * ta)
+{
+ if (NULL == ta)