My gut feeling says the ai is where the program is going haywire, but I have no way I knowing that. I'll have to do that with the logging components/levels.
matsp, Here is my DestroyTorpedo function:
as you can see, DestroyTorpedo makes torpedo 19 become torpedo 18, so that isn't a problem.
void DestroyTorpedo(int one)
log("DestroyTorpedo(%d)", one); // Added for debugging purposes
for(e = one; e < torps; e++)
torp[e] = torp[e + 1];
>> Using a standard function to provide ALL of the logging will help tremendously here.
I don't know if I follow. But I'm currently calling log(), and thats the only function I call to record this stuff.
Here is my log function
do you know of any way of increasing it's preformence?
// dolog is a boolean that I can activate during runtime by pressing L.
void log(const char *fmt, ...)
if(fmt == NULL || !dolog) return;
vsprintf(text, fmt, ap);
FILE *fp = fopen("log.txt", "a+");
fprintf(fp, "%s\r\n", text);