Correct memcpy usage

This commit is contained in:
Gymnasiast 2019-08-18 19:46:44 +02:00
parent 26b2809175
commit bf1f14b441
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
1 changed files with 1 additions and 2 deletions

View File

@ -1331,12 +1331,11 @@ void S6Exporter::ExportTileElements()
auto dst = &_s6.tile_elements[index];
if (src->base_height == 0xFF)
{
std::memcpy(dst, src, sizeof(*src));
std::memcpy(dst, src, sizeof(*dst));
}
else
{
auto tileElementType = (RCT12TileElementType)src->GetType();
// Todo: replace with setting invisibility bit
if (tileElementType == RCT12TileElementType::Corrupt || tileElementType == RCT12TileElementType::EightCarsCorrupt14
|| tileElementType == RCT12TileElementType::EightCarsCorrupt15)
std::memcpy(dst, src, sizeof(*dst));