MCPcopy Create free account
hub / github.com/Norbyte/bg3se / ApplyCodePatch

Method ApplyCodePatch

BG3Extender/GameHooks/DataLibraries.cpp:143–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 bool LibraryManager::ApplyCodePatch(std::string const& mapping)
144 {
145 auto it = mappings_.Mappings.find(mapping);
146 if (it == mappings_.Mappings.end()) {
147 ERR("Cannot apply patch - no such mapping: '%s'", mapping.c_str());
148 return false;
149 }
150
151 if (it->second.Patches.empty()) {
152 ERR("Cannot apply patch - mapping '%s' contains no patch entries", mapping.c_str());
153 return false;
154 }
155
156 bool hasChanges = false;
157 for (auto& patch : it->second.Patches) {
158 hasChanges = ApplyPatch(patch) || hasChanges;
159 }
160
161 return hasChanges;
162 }
163
164
165 bool LibraryManager::UndoCodePatch(std::string const& mapping)

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected