X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FCampaign.cpp;h=fd7519888f9ffe7622a0dda4b6095a3158351375;hb=e08372a2095837a0b951ccb68c3499ef67c1a827;hp=b02dd7bf58a66542ee193a5c16cc14fbfd7dfb76;hpb=8a32dc9e4e1011b10f009e999d7d008aa2711d8a;p=lugaru.git diff --git a/Source/Campaign.cpp b/Source/Campaign.cpp index b02dd7b..fd75198 100644 --- a/Source/Campaign.cpp +++ b/Source/Campaign.cpp @@ -55,16 +55,17 @@ std::vector ListCampaigns() void LoadCampaign() { - if (!Account::active) + if (!Account::hasActive()) { return; - std::ifstream ipstream(Folders::getResourcePath("Campaigns/" + Account::active->getCurrentCampaign() + ".txt")); + } + std::ifstream ipstream(Folders::getResourcePath("Campaigns/" + Account::active().getCurrentCampaign() + ".txt")); if (!ipstream.good()) { - if (Account::active->getCurrentCampaign() == "main") { + if (Account::active().getCurrentCampaign() == "main") { cerr << "Could not found main campaign!" << endl; return; } - cerr << "Could not found campaign \"" << Account::active->getCurrentCampaign() << "\", falling back to main." << endl; - Account::active->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 +79,16 @@ void LoadCampaign() } ipstream.close(); - std::ifstream test(Folders::getResourcePath("Textures/" + Account::active->getCurrentCampaign() + "/World.png")); + std::ifstream test(Folders::getResourcePath("Textures/" + Account::active().getCurrentCampaign() + "/World.png")); if (test.good()) { - Mainmenuitems[7].load("Textures/" + Account::active->getCurrentCampaign() + "/World.png", 0); + Mainmenuitems[7].load("Textures/" + Account::active().getCurrentCampaign() + "/World.png", 0); } else { Mainmenuitems[7].load("Textures/World.png", 0); } - if (Account::active->getCampaignChoicesMade() == 0) { - Account::active->setCampaignScore(0); - Account::active->resetFasttime(); + if (Account::active().getCampaignChoicesMade() == 0) { + Account::active().setCampaignScore(0); + Account::active().resetFasttime(); } }