switch(status)
{
case URL_READY_CANWRITE:
- // url_fopen returned, we can write
+ // we can write
prefix = strcat(autocvar_hostname, "\t", GetGametype(), "_", GetMapname(), "\t");
url_fputs(fh, "#begin statsfile\n");
url_fputs(fh, strcat("#date ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
}
}
url_fputs(fh, "#end\n\n");
- url_fclose(fh, WeaponStats_ready, world);
- buf_del(weaponstats_buffer);
- weaponstats_buffer = -1;
+ url_fclose(fh);
break;
case URL_READY_CANREAD:
// url_fclose is processing, we got a response for writing the data
while((s = url_fgets(fh)))
print(" ", s, "\n");
print("End of response.\n");
- url_fclose(fh, WeaponStats_ready, world);
+ url_fclose(fh);
break;
case URL_READY_CLOSED:
// url_fclose has finished
print("Weapon stats written\n");
+ buf_del(weaponstats_buffer);
+ weaponstats_buffer = -1;
break;
case URL_READY_ERROR:
default:
print("Weapon stats writing failed: ", ftos(status), "\n");
+ buf_del(weaponstats_buffer);
+ weaponstats_buffer = -1;
break;
}
}
return;
if(autocvar_sv_weaponstats_file != "")
{
- url_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world);
+ url_multi_fopen(autocvar_sv_weaponstats_file, FILE_APPEND, WeaponStats_ready, world);
}
else
{
self.colormap = oldself.colormap;
self.glowmod = oldself.glowmod;
self.iscreature = oldself.iscreature;
+ self.damagedbycontents = oldself.damagedbycontents;
self.angles = oldself.angles;
self.avelocity = oldself.avelocity;
self.classname = "body";