Merge pull request #55 from pnwparksfan/ImportUnknownModelsetScenarios

Import scenarios with unknown modelsets
This commit is contained in:
dexyfex 2019-10-30 22:38:57 +11:00 committed by GitHub
commit bf150eb0a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1682,7 +1682,16 @@ namespace CodeWalker.World
{
if (PedModelSets == null) return null;
AmbientModelSet ms;
PedModelSets.TryGetValue(hash, out ms);
if(!PedModelSets.TryGetValue(hash, out ms))
{
string s_hash = hash.ToString("X");
ms = new AmbientModelSet();
ms.Name = $"UNKNOWN PED MODELSET ({s_hash})";
ms.NameLower = ms.Name.ToLowerInvariant();
ms.NameHash = new MetaHash(hash);
ms.Models = new AmbientModel[] { };
PedModelSets.Add(hash, ms);
}
return ms;
}
}
@ -1692,7 +1701,16 @@ namespace CodeWalker.World
{
if (VehicleModelSets == null) return null;
AmbientModelSet ms;
VehicleModelSets.TryGetValue(hash, out ms);
if(!VehicleModelSets.TryGetValue(hash, out ms))
{
string s_hash = hash.ToString("X");
ms = new AmbientModelSet();
ms.Name = $"UNKNOWN VEHICLE MODELSET ({s_hash})";
ms.NameLower = ms.Name.ToLowerInvariant();
ms.NameHash = new MetaHash(hash);
ms.Models = new AmbientModel[] {};
VehicleModelSets.Add(hash, ms);
}
return ms;
}
}