]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
playerstats: make URL_READY_CANWRITE idempotent
authorRudolf Polzer <divVerent@xonotic.org>
Thu, 6 Oct 2011 14:05:44 +0000 (16:05 +0200)
committerRudolf Polzer <divVerent@xonotic.org>
Thu, 6 Oct 2011 14:05:44 +0000 (16:05 +0200)
qcsrc/server/playerstats.qc

index a15c2b1341588b896c2beae564c3dcbe0ea4fa10..a2af63fe9ab74faa96232042640b8cb52b3ceb12 100644 (file)
@@ -235,8 +235,6 @@ void PlayerStats_ready(entity fh, entity pass, float status)
                                }
                        }
                        url_fputs(fh, "\n");
-                       db_close(playerstats_db);
-                       playerstats_db = -1;
                        url_fclose(fh, PlayerStats_ready, world);
                        break;
                case URL_READY_CANREAD:
@@ -252,6 +250,8 @@ void PlayerStats_ready(entity fh, entity pass, float status)
                        // url_fclose has finished
                        print("Player stats written\n");
                        playerstats_waitforme = TRUE;
+                       db_close(playerstats_db);
+                       playerstats_db = -1;
                        break;
                case URL_READY_ERROR:
                default: