- Posts: 452
- Thank you received: 79
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Liko wrote: Loading:
Code:if (!get_line(obj_f, line)) { log("SYSERR: Expecting fourth numeric line of %s, but file ended!", buf2); exit(1); } if ((retval = sscanf(line, "%d %d", t, t + 1)) != 2) { if(retval == 0) { t[0] = 0; t[1] = 0; } else if(retval == 1) t[1] = 0; else { log("SYSERR: Format error in fourth numeric line (expecting 2 args, got %d), %s", retval, buf2); exit(1); } } GET_OBJ_SOCKET_MIN(obj_proto + i) = t[0]; GET_OBJ_SOCKET_MAX(obj_proto + i) = t[1]; case 'B': if (b >= MAX_SOCKET_AFFECT) { log("SYSERR: Too many B fields (%d max), %s", MAX_SOCKET_AFFECT, buf2); exit(1); } if (!get_line(obj_f, line)) { log("SYSERR: Format error in 'B' field, %s\n" "...expecting 2 numeric constants but file ended!", buf2); exit(1); } if ((retval = sscanf(line, " %d %d ", t, t + 1)) != 2) { log("SYSERR: Format error in 'B' field, %s\n" "...expecting 2 numeric arguments, got %d\n" "...offending line: '%s'", buf2, retval, line); exit(1); } obj_proto[i].bonus[b].location = t[0]; obj_proto[i].bonus[b].modifier = t[1]; b++; break;
Saving:
GENOBJ.C
Code:fprintf(fp, "%d %s %s %s %s %s %s %s %s %s %s %s %s\n" "%d %d %d %d\n" "%d %d %d %d %d\n" "%d %d\n", GET_OBJ_TYPE(obj), ebuf1, ebuf2, ebuf3, ebuf4, wbuf1, wbuf2, wbuf3, wbuf4, pbuf1, pbuf2, pbuf3, pbuf4, GET_OBJ_VAL(obj, 0), GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 3), GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj), GET_OBJ_TIMER(obj), GET_OBJ_SOCKET_MIN(obj), GET_OBJ_SOCKET_MAX(obj) ); for (counter3 = 0; counter3 < MAX_SOCKET_AFFECT; counter3++) if(obj->bonus[counter3].modifier) fprintf(fp, "B\n" "%d %d\n", obj->bonus[counter3].location, obj->bonus[counter3].modifier);
OBJSAVE.c
Code:for (counter3 = 0; counter3 < MAX_SOCKET_AFFECT; counter3++) if (obj->bonus[counter3].modifier != temp->bonus[counter3].modifier) fprintf(fp, "Bon : %d %d %d\n", counter3, obj->bonus[counter3].location, obj->bonus[counter3].modifier ); if (!strcmp(tag, "Bon ")) { sscanf(line, "%d %d %d", &t[0], &t[1], &t[2]); if(t[0] < MAX_SOCKET_AFFECT) { temp->bonus[t[0]].location = t[1]; temp->bonus[t[0]].modifier = t[2]; } } break;
The error i'm getting is:
Code:strcat(buf2, ", after numeric constants\n" /* strcat: OK (for 'buf2 >= 87') */ "...expecting 'E', 'A', 'B', '$', or next object number");
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024