Update ZoneBuilder.cpp for building CoDOL Maps

AssetHandler::ModifyAsset checks the zone version and then applies a patch, this won't work with maps compiled with zonebuilder because the ff version is the same as other iw4 zones.  Therefore the sortkey needs to be fixed when the map gets built instead of at runtime.
This commit is contained in:
Michael Maurer II 2023-08-29 00:12:56 +00:00 committed by GitHub
parent adee95a9de
commit f2e373a793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,6 +259,23 @@ namespace Components
return false;
}
//patch for codol maps dumped with zonetool, the FF version is changed, so the sortKey hack in AssetHandler::ModifyAsset won't work
if (type == Game::XAssetType::ASSET_TYPE_GFXWORLD)
{
if (assetHeader.gfxWorld->sortKeyDistortion == 44)
{
assetHeader.gfxWorld->sortKeyDistortion = 43;
}
}
//likewise if material's sortKey is 44, it needs to be changed to 43.
if (type == Game::XAssetType::ASSET_TYPE_MATERIAL)
{
if (assetHeader.material->info.sortKey == 44)
{
assetHeader.material->info.sortKey = 43;
}
}
Game::XAsset asset;
asset.type = type;
asset.header = assetHeader;