]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Campaign.cpp
Moved Account::active in Account class. Maybe it should be changed for a method and...
[lugaru.git] / Source / Campaign.cpp
index f46b7d299b4c7a90e7cf92a77f3ad4a9662e27ab..b02dd7bf58a66542ee193a5c16cc14fbfd7dfb76 100644 (file)
@@ -55,16 +55,16 @@ std::vector<std::string> ListCampaigns()
 
 void LoadCampaign()
 {
-    if (!accountactive)
+    if (!Account::active)
         return;
-    std::ifstream ipstream(Folders::getResourcePath("Campaigns/" + accountactive->getCurrentCampaign() + ".txt"));
+    std::ifstream ipstream(Folders::getResourcePath("Campaigns/" + Account::active->getCurrentCampaign() + ".txt"));
     if (!ipstream.good()) {
-        if (accountactive->getCurrentCampaign() == "main") {
+        if (Account::active->getCurrentCampaign() == "main") {
             cerr << "Could not found main campaign!" << endl;
             return;
         }
-        cerr << "Could not found campaign \"" << accountactive->getCurrentCampaign() << "\", falling back to main." << endl;
-        accountactive->setCurrentCampaign("main");
+        cerr << "Could not found campaign \"" << Account::active->getCurrentCampaign() << "\", falling back to main." << endl;
+        Account::active->setCurrentCampaign("main");
         return LoadCampaign();
     }
     ipstream.ignore(256, ':');
@@ -78,16 +78,16 @@ void LoadCampaign()
     }
     ipstream.close();
 
-    std::ifstream test(Folders::getResourcePath("Textures/" + accountactive->getCurrentCampaign() + "/World.png"));
+    std::ifstream test(Folders::getResourcePath("Textures/" + Account::active->getCurrentCampaign() + "/World.png"));
     if (test.good()) {
-        Mainmenuitems[7].load("Textures/" + accountactive->getCurrentCampaign() + "/World.png", 0);
+        Mainmenuitems[7].load("Textures/" + Account::active->getCurrentCampaign() + "/World.png", 0);
     } else {
         Mainmenuitems[7].load("Textures/World.png", 0);
     }
 
-    if (accountactive->getCampaignChoicesMade() == 0) {
-        accountactive->setCampaignScore(0);
-        accountactive->resetFasttime();
+    if (Account::active->getCampaignChoicesMade() == 0) {
+        Account::active->setCampaignScore(0);
+        Account::active->resetFasttime();
     }
 }