- moa->id = atoi(strtok(line, delim));
- moa->effort = atoi(strtok(NULL, delim));
- char * funcname = strtok(NULL, "\n");
- uint8_t len_name = strlen(funcname) + 1;
+ err_try_fgets(line, linemax, file, context, "nfi");
+ err_line(atoi(line) > UINT8_MAX, line, context, err_toolarge);
+ moa->id = atoi(line);
+ struct MapObjAct * moa_test = world.map_obj_acts;
+ for (; NULL != moa_test; moa_test = moa_test->next)
+ {
+ err_line(moa->id == moa_test->id, line, context, err_uniq);
+ }
+ err_try_fgets(line, linemax, file, context, "0nfi");
+ err_line(atoi(line) > UINT8_MAX, line, context, err_toolarge);
+ moa->effort = atoi(line);
+ err_try_fgets(line, linemax, file, context, "0nf");
+ line[strlen(line) - 1] = '\0';
+ uint8_t len_name = strlen(line) + 1;