]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
Merge remote-tracking branch 'origin/fruitiex/animations'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index 05a809dd371b8bb96bcf1f72498fbd6240cdc2fa..15bb65262416f298cbc356e9054c94acf9ed87a3 100644 (file)
@@ -21,7 +21,7 @@ void WeaponStats_ready(entity fh, entity pass, float status)
        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"));
@@ -46,9 +46,7 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                                        }
                                }
                        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
@@ -57,15 +55,19 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                        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;
        }
 }
@@ -76,7 +78,7 @@ void WeaponStats_Shutdown()
                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
        {
@@ -134,6 +136,7 @@ void CopyBody(float keepvelocity)
        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";