| 71 | } |
| 72 | |
| 73 | bool cCampaign::LoadCustomMapFromPath(const std::string& pPath) { |
| 74 | Clear(); |
| 75 | std::string CustomMapName = pPath; |
| 76 | |
| 77 | auto a = CustomMapName.find_last_of("/") + 1; |
| 78 | CustomMapName.erase(CustomMapName.begin(), CustomMapName.begin() + a); |
| 79 | |
| 80 | LoadCustomMap(CustomMapName); |
| 81 | |
| 82 | // Change the path to this map |
| 83 | std::shared_ptr<cPhase> Phase = mMissions.back()->mPhases.back(); |
| 84 | Phase->mMapFilename = pPath.substr(0, pPath.size() - 4); |
| 85 | |
| 86 | mUseCustomPath = true; |
| 87 | return true; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Load a single custom map |
no test coverage detected