-static uint8_t parse_position(char* tok0, char * tok1, struct Thing * t)
-{
- char axis = 0;
- if (!strcmp(tok0, s[S_CMD_POS_Y]))
- {
- axis = 'y';
- }
- else if (!strcmp(tok0, s[S_CMD_POS_X]))
- {
- axis = 'x';
- }
- if (axis && !parsetest_int(tok1, '8'))
- {
- uint8_t length = atoi(tok1);
- char * err = "Position is outside of map.";
- if (!err_line(length >= world.map.length, err))
- {
- if ('y' == axis)
- {
- t->pos.y = length;
- }
- else if ('x' == axis)
- {
- t->pos.x = length;
- }
- free(t->fov_map);
- t->fov_map= do_fov && t->lifepoints ? build_fov_map(t) : t->fov_map;
- }
- return 1;
- }
- return 0;
-}
-
-
-
-static uint8_t parse_thing_type(char * tok0, char * tok1, struct Thing * t)
-{
- uint8_t type;
- if (parse_val(tok0, tok1, s[S_CMD_TYPE], '8', (char *) &type))
- {
- struct ThingType * tt = world.thing_types;
- for (; NULL != tt && type != tt->id; tt = tt->next);
- if (!err_line(!tt, "Thing type does not exist."))
- {
- t->type = type;
- }
- return 1;
- }
- return 0;
-}
-
-
-
-static uint8_t parse_thing_command(char * tok0, char * tok1, struct Thing * t)
-{
- uint8_t command;
- if (parse_val(tok0, tok1, s[S_CMD_COMMAND], '8', (char *) &command))
- {
- if (!command)
- {
- t->command = command;
- return 1;
- }
- struct ThingAction * ta = world.thing_actions;
- for (; NULL != ta && command != ta->id; ta = ta->next);
- if (!err_line(!ta, "Thing action does not exist."))
- {
- t->command = command;
- }
- return 1;
- }
- return 0;
-}
-
-
-
-static uint8_t parse_do_fov(char * tok0, char * tok1)