Only read clipmap models if we have a clipmap model count

This commit is contained in:
rackover 2021-04-05 23:19:40 +02:00
parent aa85b95740
commit ace08107fe
2 changed files with 29 additions and 21 deletions

View File

@ -885,6 +885,7 @@ namespace Assets
// add triggers to mapEnts
if (version >= 2) {
if (clipMap->numSubModels > 0) {
clipMap->mapEnts->trigger.count = clipMap->numSubModels;
clipMap->mapEnts->trigger.hullCount = clipMap->numSubModels;
@ -909,6 +910,7 @@ namespace Assets
clipMap->mapEnts->trigger.hulls = &hulls[0];
clipMap->mapEnts->trigger.slabs = &slabs[0];
}
}
clipMap->checksum = reader.read<int>();

View File

@ -222,8 +222,14 @@ namespace Components
}
Game::XAssetHeader assetHeader = AssetHandler::FindAssetForZone(type, name, this, isSubAsset);
if (type == Game::XAssetType::ASSET_TYPE_LOADED_SOUND) {
Logger::Print("Loading loaded_sound '%s'\n", name.data());
}
if (!assetHeader.data)
{ Logger::Error("Error: Missing asset '%s' of type '%s'\n", name.data(), Game::DB_GetXAssetTypeName(type));
{
Logger::Error("Error: Missing asset '%s' of type '%s'\n", name.data(), Game::DB_GetXAssetTypeName(type));
return false;
}