Slightly handle unfound models
This commit is contained in:
parent
47d95307b5
commit
7ec7f71239
|
@ -1,4 +1,4 @@
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using KeepersCompound.LGS;
|
using KeepersCompound.LGS;
|
||||||
using KeepersCompound.LGS.Database;
|
using KeepersCompound.LGS.Database;
|
||||||
|
@ -151,15 +151,20 @@ class Program
|
||||||
{
|
{
|
||||||
var resName = $"{propModelname.value.ToLower()}.bin";
|
var resName = $"{propModelname.value.ToLower()}.bin";
|
||||||
var modelPath = campaign.GetResourcePath(ResourceType.Object, resName);
|
var modelPath = campaign.GetResourcePath(ResourceType.Object, resName);
|
||||||
var model = new ModelFile(modelPath);
|
if (modelPath != null)
|
||||||
if (model.TryGetVhot(ModelFile.VhotId.LightPosition, out var vhot))
|
|
||||||
{
|
{
|
||||||
baseLight.position += vhot.Position;
|
// TODO: Handle failing to find model more gracefully
|
||||||
}
|
var model = new ModelFile(modelPath);
|
||||||
if (model.TryGetVhot(ModelFile.VhotId.LightDirection, out vhot))
|
if (model.TryGetVhot(ModelFile.VhotId.LightPosition, out var vhot))
|
||||||
{
|
{
|
||||||
baseLight.spotlightDir = vhot.Position;
|
baseLight.position += vhot.Position;
|
||||||
|
}
|
||||||
|
if (model.TryGetVhot(ModelFile.VhotId.LightDirection, out vhot))
|
||||||
|
{
|
||||||
|
baseLight.spotlightDir = vhot.Position;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (propSpotlight != null)
|
if (propSpotlight != null)
|
||||||
|
|
Loading…
Reference in New Issue