[IMapEnts] Use IW4C if available

This commit is contained in:
momo5502 2016-12-31 15:53:48 +01:00
parent aafa121ff1
commit 6e689766df

View File

@ -17,13 +17,18 @@ namespace Assets
// TODO: Get rid of that // TODO: Get rid of that
if (!orgEnts) if (!orgEnts)
{ {
Game::DB_EnumXAssets(Game::XAssetType::ASSET_TYPE_MAP_ENTS, [](Game::XAssetHeader header, void* mapEnts) orgEnts = Components::AssetHandler::FindOriginalAsset(Game::XAssetType::ASSET_TYPE_MAP_ENTS, "maps/iw4_credits.d3dbsp").mapEnts;
if (!orgEnts)
{ {
if (!*reinterpret_cast<void**>(mapEnts)) Game::DB_EnumXAssets(Game::XAssetType::ASSET_TYPE_MAP_ENTS, [](Game::XAssetHeader header, void* mapEnts)
{ {
*reinterpret_cast<Game::MapEnts**>(mapEnts) = header.mapEnts; if (!*reinterpret_cast<void**>(mapEnts))
} {
}, &orgEnts, false); *reinterpret_cast<Game::MapEnts**>(mapEnts) = header.mapEnts;
}
}, &orgEnts, false);
}
} }
if (orgEnts) if (orgEnts)