QTfrontend/team.cpp
changeset 3381 f8800c44b3de
parent 3359 d17b9f6adae5
child 3697 d5b30d6373fc
--- a/QTfrontend/team.cpp	Thu Apr 29 19:40:13 2010 +0000
+++ b/QTfrontend/team.cpp	Thu Apr 29 21:25:51 2010 +0000
@@ -50,6 +50,8 @@
         binds[i].action = cbinds[i].action;
         binds[i].strbind = cbinds[i].strbind;
     }
+    Rounds = 0;
+    Wins = 0;
 }
 
 HWTeam::HWTeam(const QStringList& strLst) :
@@ -73,6 +75,8 @@
 // Checking net teams is probably pointless, but can't hurt.
         if (Hedgehogs[i].Hat.length() == 0) Hedgehogs[i].Hat = "NoHat"; 
     }
+    Rounds = 0;
+    Wins = 0;
 }
 
 HWTeam::HWTeam() :
@@ -97,6 +101,8 @@
         binds[i].action = cbinds[i].action;
         binds[i].strbind = cbinds[i].strbind;
     }
+    Rounds = 0;
+    Wins = 0;
 }
 
 
@@ -110,6 +116,8 @@
     Voicepack = teamfile.value("Team/Voicepack", "Default").toString();
     Flag = teamfile.value("Team/Flag", "hedgewars").toString();
     difficulty = teamfile.value("Team/Difficulty", 0).toInt();
+    Rounds = teamfile.value("Team/Rounds", 0).toInt();
+    Wins = teamfile.value("Team/Wins", 0).toInt();
     for(int i = 0; i < 8; i++)
     {
         QString hh = QString("Hedgehog%1/").arg(i);
@@ -130,6 +138,12 @@
     return true;
 }
 
+bool HWTeam::FileExists()
+{
+    QFile f(cfgdir->absolutePath() + "/Teams/" + TeamName + ".ini");
+    return f.exists();
+}
+
 bool HWTeam::DeleteFile()
 {
     if(m_isNetTeam)
@@ -155,6 +169,8 @@
     teamfile.setValue("Team/Voicepack", Voicepack);
     teamfile.setValue("Team/Flag", Flag);
     teamfile.setValue("Team/Difficulty", difficulty);
+    teamfile.setValue("Team/Rounds", Rounds);
+    teamfile.setValue("Team/Wins", Wins);
     for(int i = 0; i < 8; i++)
     {
         QString hh = QString("Hedgehog%1/").arg(i);