diff --git a/src/Components/Modules/FastFiles.cpp b/src/Components/Modules/FastFiles.cpp index 118fc4a8..0c2f5d18 100644 --- a/src/Components/Modules/FastFiles.cpp +++ b/src/Components/Modules/FastFiles.cpp @@ -239,6 +239,27 @@ namespace Components paths.push_back(Utils::String::VA("%s\\", modDir.data())); } + if(Utils::String::StartsWith(file, "mp_")) + { + std::string zone = file; + if(Utils::String::EndsWith(zone, ".ff")) + { + Utils::String::Replace(zone, ".ff", ""); + } + + std::string filename = zone; + + if (Utils::String::EndsWith(zone, "_load")) + { + Utils::String::Replace(zone, "_load", ""); + } + + if(Utils::IO::FileExists(Utils::String::VA("usermaps\\%s\\%s.ff", zone.data(), filename.data()))) + { + return Utils::String::VA("usermaps\\%s\\", zone.data()); + } + } + Utils::Merge(&paths, FastFiles::ZonePaths); for (auto &path : paths) diff --git a/src/Components/Modules/QuickPatch.cpp b/src/Components/Modules/QuickPatch.cpp index ae3d5208..1b53f089 100644 --- a/src/Components/Modules/QuickPatch.cpp +++ b/src/Components/Modules/QuickPatch.cpp @@ -673,16 +673,17 @@ namespace Components float cyan[4] = { 0.0f, 0.5f, 0.5f, 1.0f }; - Game::GfxWorld** gameWorld = reinterpret_cast(0x66DEE94); - if (!*gameWorld) return; + Game::GfxWorld*& gameWorld = *reinterpret_cast(0x66DEE94); + if (!gameWorld) return; - for (int i = 0; i < (*gameWorld)->dpvsPlanes.cellCount; ++i) + for (int i = 0; i < gameWorld->dpvsPlanes.cellCount; ++i) { - for (int j = 0; j < (*gameWorld)->aabbTreeCounts[i].aabbTreeCount; ++j) + for (int j = 0; j < gameWorld->aabbTreeCounts[i].aabbTreeCount; ++j) { Game::vec3_t v1, v2, v3, v4, v5, v6, v7, v8; - float* center = (*gameWorld)->aabbTrees[i].aabbTree[j].bounds.midPoint; - float* halfSize = (*gameWorld)->aabbTrees[i].aabbTree[j].bounds.halfSize; + float* center = gameWorld->aabbTrees[i].aabbTree[j].bounds.midPoint; + float* halfSize = gameWorld->aabbTrees[i].aabbTree[j].bounds.halfSize; + v1[0] = center[0] - halfSize[0]; v1[1] = center[1] - halfSize[1]; v1[2] = center[2] - halfSize[2];