}
}
}
- else if (parse_val(tok0, tok1, s[S_CMD_THINGACTION], '8', (char *) &id))
+ else if (parse_val(tok0, tok1, s[S_CMD_THINGACTION], 'i', (char *) &id))
{
ta = get_thing_action(id);
if (!ta)
return 1;
}
uint8_t id;
- if ( parse_thing_type(tok0, tok1, t)
+ if ( parse_thing_type(tok0, tok1, t)
|| parse_thing_command(tok0, tok1, t)
|| parse_val(tok0,tok1, s[S_CMD_T_ARGUMENT], '8', (char *)&t->arg)
|| parse_val(tok0,tok1, s[S_CMD_T_PROGRESS], '8', (char *)&t->progress)
/* To linked list of NextAndId structs (or rather structs whose start region is
* compatible to it) starting at "start", add newly allocated element of
* "n_size" and an ID that is either "id" or, if "id" is <= UINT8_MAX and >=
- * "id_start", get lowest ID for new thing ("struct_id"==0), thing type
- * ("struct_id"==1) or thing action ("struct_id"==2).
+ * "id_start", get lowest ID >= "start_id" and <= UINT8_MAX for new thing
+ * ("struct_id"=0), thing type ("struct_id"=1) or thing action ("struct_id"=2).
*/
static struct NextAndId * add_to_struct_list(size_t n_size, uint8_t start_id,
int16_t id, uint8_t struct_id,
&world.thing_types);
set_cleanup_flag(CLEANUP_THING_TYPES);
tt->name = strdup("(none)");
+ tt->corpse_id = tt->id;
return tt;
}
*/
extern struct ThingAction * add_thing_action(uint8_t id);
-/* Add thing type of "id", with .corpse_id defaulting to "id" to
- * world.thing_types, .name to "(none)" and the remaining values to 0. If "id"
- * is not >= 0 and <= UINT8_MAX, use lowest unused id. Return thing type.
+/* Add thing type of "id" to world.thing_types, with .corpse_id defaulting to
+ * the new thing type's .id, .name to "(none)" and the remaining values to 0. If
+ * "id" is not >= 0 and <= UINT8_MAX, use lowest unused id. Return thing type.
*/
extern struct ThingType * add_thing_type(int16_t id);
-/* Add thing of "id" and "type" on position of "y"/x" to world.things.If "id" is
- * not >= 0 and <= UINT8_MAX, use lowest unused id. Return thing.
+/* Add thing of "id" and "type" on position of "y"/x" to world.things. If "id"
+ * is not >= 0 and <= UINT8_MAX, use lowest unused id. Return thing.
*/
extern struct Thing * add_thing(int16_t id, uint8_t type, uint8_t y, uint8_t x);