From a2c8705868f8e3f1f8c70539e0d25ebed7bf0621 Mon Sep 17 00:00:00 2001 From: rackover Date: Tue, 6 Apr 2021 11:33:14 +0200 Subject: [PATCH] Do not overwrite a techniqueset with another, the game really doesn't like taht --- src/Components/Modules/AssetInterfaces/IMaterial.cpp | 8 +++----- src/Components/Modules/Maps.cpp | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Components/Modules/AssetInterfaces/IMaterial.cpp b/src/Components/Modules/AssetInterfaces/IMaterial.cpp index ccd12e4b..17e95947 100644 --- a/src/Components/Modules/AssetInterfaces/IMaterial.cpp +++ b/src/Components/Modules/AssetInterfaces/IMaterial.cpp @@ -206,7 +206,8 @@ namespace Assets if (!t1->techniques[i] && !t2->techniques[i]) continue;; if (!t1->techniques[i] || !t2->techniques[i]) return false; - if (t1->techniques[i]->flags != t2->techniques[i]->flags) return false; + // Apparently, this is really not that important + //if (t1->techniques[i]->flags != t2->techniques[i]->flags) return false; } return true; @@ -238,8 +239,6 @@ namespace Assets Game::XAssetEntry* entry = Game::DB_FindXAssetEntry(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, iw4TechSetName.data()); if (entry) { - asset->techniqueSet = entry->asset.header.techniqueSet; - Game::DB_EnumXAssetEntries(Game::XAssetType::ASSET_TYPE_MATERIAL, [asset](Game::XAssetEntry* entry) { if (!replacementFound) @@ -264,9 +263,8 @@ namespace Assets } } else { - Components::Logger::Print("Could not match iw3 techset %s with any of the techsets I know! This is a critical error, the map will not be playable.\n", asset->techniqueSet->name); + Components::Logger::Print("Could not match iw3 techset %s with any of the techsets I know! This is a critical error, there's a good chance the map will not be playable.\n", asset->techniqueSet->name); } - } if (!reader.end()) diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 6b9b8ffb..daaac1bc 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -750,7 +750,9 @@ namespace Components } int16 Maps::CM_TriggerModelBounds(int modelPointer, Game::Bounds* bounds) { - //Game::MapEnts* ents = *reinterpret_cast(0x1AA651C); // Use me for debugging +#ifdef DEBUG + Game::MapEnts* ents = *reinterpret_cast(0x1AA651C); // Use me for debugging +#endif return Utils::Hook::Call(0x4416C0)(modelPointer, bounds); }