Do not overwrite a techniqueset with another, the game really doesn't like taht

This commit is contained in:
rackover 2021-04-06 11:33:14 +02:00
parent ace08107fe
commit a2c8705868
2 changed files with 6 additions and 6 deletions

View File

@ -206,7 +206,8 @@ namespace Assets
if (!t1->techniques[i] && !t2->techniques[i]) continue;; if (!t1->techniques[i] && !t2->techniques[i]) continue;;
if (!t1->techniques[i] || !t2->techniques[i]) return false; 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; return true;
@ -238,8 +239,6 @@ namespace Assets
Game::XAssetEntry* entry = Game::DB_FindXAssetEntry(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, iw4TechSetName.data()); Game::XAssetEntry* entry = Game::DB_FindXAssetEntry(Game::XAssetType::ASSET_TYPE_TECHNIQUE_SET, iw4TechSetName.data());
if (entry) { if (entry) {
asset->techniqueSet = entry->asset.header.techniqueSet;
Game::DB_EnumXAssetEntries(Game::XAssetType::ASSET_TYPE_MATERIAL, [asset](Game::XAssetEntry* entry) Game::DB_EnumXAssetEntries(Game::XAssetType::ASSET_TYPE_MATERIAL, [asset](Game::XAssetEntry* entry)
{ {
if (!replacementFound) if (!replacementFound)
@ -264,9 +263,8 @@ namespace Assets
} }
} }
else { 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()) if (!reader.end())

View File

@ -750,7 +750,9 @@ namespace Components
} }
int16 Maps::CM_TriggerModelBounds(int modelPointer, Game::Bounds* bounds) { int16 Maps::CM_TriggerModelBounds(int modelPointer, Game::Bounds* bounds) {
//Game::MapEnts* ents = *reinterpret_cast<Game::MapEnts**>(0x1AA651C); // Use me for debugging #ifdef DEBUG
Game::MapEnts* ents = *reinterpret_cast<Game::MapEnts**>(0x1AA651C); // Use me for debugging
#endif
return Utils::Hook::Call<int16(int, Game::Bounds*)>(0x4416C0)(modelPointer, bounds); return Utils::Hook::Call<int16(int, Game::Bounds*)>(0x4416C0)(modelPointer, bounds);
} }