fix: Multiple file provider resize issues

This commit is contained in:
WerWolv
2023-06-03 23:57:41 +02:00
parent 6d19b33e32
commit de76c37ffb
2 changed files with 9 additions and 5 deletions

View File

@@ -62,6 +62,11 @@ namespace hex::prv {
file.writeBuffer(buffer.data(), bufferSize);
}
for (auto &[patchAddress, patch] : getPatches()) {
file.seek(patchAddress - this->getBaseAddress());
file.writeBuffer(&patch, 1);
}
EventManager::post<EventProviderSaved>(this);
}
}
@@ -130,13 +135,13 @@ namespace hex::prv {
}
void Provider::applyPatches() {
if (!this->isWritable())
return;
for (auto &[patchAddress, patch] : getPatches()) {
this->writeRaw(patchAddress - this->getBaseAddress(), &patch, 1);
}
if (!this->isWritable())
return;
this->markDirty();
this->m_patches.emplace_back();