No structured data shenanigans while dumping

This commit is contained in:
Louvenarde 2024-01-13 21:10:15 +01:00
parent 4badcdd008
commit 70f34a9319
2 changed files with 120 additions and 115 deletions

View File

@ -165,6 +165,10 @@ namespace Components
// TODO: Since all of the following is zonebuilder-only code, move it to IW4OF or IStructuredDataDefSet.cpp // TODO: Since all of the following is zonebuilder-only code, move it to IW4OF or IStructuredDataDefSet.cpp
AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader asset, const std::string& filename, bool* /*restrict*/) AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader asset, const std::string& filename, bool* /*restrict*/)
{ {
if (ZoneBuilder::IsDumpingZone()) {
return;
}
// Only intercept playerdatadef loading // Only intercept playerdatadef loading
if (type != Game::ASSET_TYPE_STRUCTURED_DATA_DEF || filename != "mp/playerdata.def") return; if (type != Game::ASSET_TYPE_STRUCTURED_DATA_DEF || filename != "mp/playerdata.def") return;

View File

@ -129,6 +129,7 @@ namespace Components
#endif #endif
static bool IsEnabled(); static bool IsEnabled();
static bool IsDumpingZone() { return DumpingZone.length() > 0; };
static std::string TraceZone; static std::string TraceZone;
static std::vector<std::pair<Game::XAssetType, std::string>> TraceAssets; static std::vector<std::pair<Game::XAssetType, std::string>> TraceAssets;