Merge pull request #616 from diamante0018/develop

[RawFile]: Remove copy & pasted code
This commit is contained in:
Edo 2022-12-01 15:09:18 +00:00 committed by GitHub
commit 2bc9564738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ namespace Assets
// Only save the compressed buffer if we gained space
if (compressedData.size() < rawFile.getBuffer().size())
{
asset->buffer = builder->getAllocator()->duplicateString(compressedData);
asset->buffer = builder->getAllocator()->allocateArray<char>(compressedData.size());
std::memcpy(const_cast<char*>(asset->buffer), compressedData.data(), compressedData.size());
asset->compressedLen = static_cast<int>(compressedData.size());
}

View File

@ -519,7 +519,7 @@ namespace Components
void ZoneBuilder::Zone::addBranding()
{
constexpr auto* data = "Built using the IW4x Zone:B:uilder Version 4";
auto dataLen = std::strlen(data) + 1;
auto dataLen = std::strlen(data); // + 1 is added by the save code
this->branding = { this->zoneName.data(), 0, static_cast<int>(dataLen), data };