MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / LoadCustomMapFromPath

Method LoadCustomMapFromPath

Source/Campaign.cpp:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73bool 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

Callers 1

Calls 3

eraseMethod · 0.80
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected