Merge remote-tracking branch 'origin/zykure/teamscores'
authorSamual Lenks <samual@xonotic.org>
Sat, 1 Jun 2013 19:47:42 +0000 (15:47 -0400)
committerSamual Lenks <samual@xonotic.org>
Sat, 1 Jun 2013 19:47:42 +0000 (15:47 -0400)
1  2 
qcsrc/server/playerstats.qc

@@@ -159,14 -159,18 +159,18 @@@ float PlayerStats_Event(entity e, strin
        return val;
  }
  
void PlayerStats_TeamScore(float t, string event_id, float value)
float PlayerStats_TeamScore(float t, string event_id, float value)
  {
+       if(playerstats_db < 0)
+               return 0;
        string key;
        float val;
        key = sprintf("team#%d:%s", t, event_id);
        val = stof(db_get(playerstats_db, key));
        val += value;
        db_put(playerstats_db, key, ftos(val));
+       return val;
  }
  
  /*
@@@ -227,7 -231,7 +231,7 @@@ void PlayerStats_ready(entity fh, entit
        switch(status)
        {
                case URL_READY_CANWRITE:
 -                      url_fputs(fh, "V 6\n");
 +                      url_fputs(fh, "V 7\n");
  #ifdef WATERMARK
                        url_fputs(fh, sprintf("R %s\n", WATERMARK));
  #endif