From 3b3985b1593510e1bd850f2f42fecd7dd2103e7a Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 29 Dec 2016 23:52:23 +0100 Subject: [PATCH] [IMapEnts] Fix raw entity loading --- src/Components/Modules/AssetInterfaces/IMapEnts.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Components/Modules/AssetInterfaces/IMapEnts.cpp b/src/Components/Modules/AssetInterfaces/IMapEnts.cpp index 7c15c0c1..bbcf2fab 100644 --- a/src/Components/Modules/AssetInterfaces/IMapEnts.cpp +++ b/src/Components/Modules/AssetInterfaces/IMapEnts.cpp @@ -14,6 +14,18 @@ namespace Assets Game::MapEnts* entites = builder->getAllocator()->allocate(); Game::MapEnts* orgEnts = Components::AssetHandler::FindOriginalAsset(this->getType(), name.data()).mapEnts; + // TODO: Get rid of that + if (!orgEnts) + { + Game::DB_EnumXAssets(Game::XAssetType::ASSET_TYPE_MAP_ENTS, [](Game::XAssetHeader header, void* mapEnts) + { + if (!*reinterpret_cast(mapEnts)) + { + *reinterpret_cast(mapEnts) = header.mapEnts; + } + }, &orgEnts, false); + } + if (orgEnts) { std::memcpy(entites, orgEnts, sizeof Game::MapEnts);