mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-08-20 08:59:21 +08:00
Made RenderWorldAddInteriorEntities more robust
This commit is contained in:
parent
fa1a3ac00e
commit
cd4eee4dc5
@ -2064,12 +2064,12 @@ namespace CodeWalker.Rendering
|
|||||||
}
|
}
|
||||||
private void RenderWorldAddInteriorEntities(YmapEntityDef ent)
|
private void RenderWorldAddInteriorEntities(YmapEntityDef ent)
|
||||||
{
|
{
|
||||||
if (ent.MloInstance.Entities != null)
|
if (ent?.MloInstance?.Entities != null)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < ent.MloInstance.Entities.Length; j++)
|
for (int j = 0; j < ent.MloInstance.Entities.Length; j++)
|
||||||
{
|
{
|
||||||
var intent = ent.MloInstance.Entities[j];
|
var intent = ent.MloInstance.Entities[j];
|
||||||
if (intent.Archetype == null) continue; //missing archetype...
|
if (intent?.Archetype == null) continue; //missing archetype...
|
||||||
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
||||||
|
|
||||||
intent.IsVisible = true;
|
intent.IsVisible = true;
|
||||||
@ -2082,19 +2082,19 @@ namespace CodeWalker.Rendering
|
|||||||
renderworldentities.Add(intent);
|
renderworldentities.Add(intent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ent.MloInstance.EntitySets != null)
|
if (ent?.MloInstance?.EntitySets != null)
|
||||||
{
|
{
|
||||||
for (int e = 0; e < ent.MloInstance.EntitySets.Length; e++)
|
for (int e = 0; e < ent.MloInstance.EntitySets.Length; e++)
|
||||||
{
|
{
|
||||||
var entityset = ent.MloInstance.EntitySets[e];
|
var entityset = ent.MloInstance.EntitySets[e];
|
||||||
if (!entityset.VisibleOrForced) continue;
|
if ((entityset == null) || (!entityset.VisibleOrForced)) continue;
|
||||||
|
|
||||||
var entities = entityset.Entities;
|
var entities = entityset.Entities;
|
||||||
if (entities == null) continue;
|
if (entities == null) continue;
|
||||||
for (int i = 0; i < entities.Count; i++)
|
for (int i = 0; i < entities.Count; i++)
|
||||||
{
|
{
|
||||||
var intent = entities[i];
|
var intent = entities[i];
|
||||||
if (intent.Archetype == null) continue; //missing archetype...
|
if (intent?.Archetype == null) continue; //missing archetype...
|
||||||
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
||||||
|
|
||||||
intent.IsVisible = true;
|
intent.IsVisible = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user