Fix for crash when changing entity archetypes

This commit is contained in:
dexy 2019-12-27 20:33:13 +11:00
parent 3f445182f3
commit 906602eb13

View File

@ -2088,6 +2088,8 @@ namespace CodeWalker.Rendering
private bool RenderIsEntityFinalRender(YmapEntityDef ent) private bool RenderIsEntityFinalRender(YmapEntityDef ent)
{ {
var arch = ent.Archetype; var arch = ent.Archetype;
if (arch == null) return false;
bool isshadowproxy = false; bool isshadowproxy = false;
bool isreflproxy = false; bool isreflproxy = false;
uint archflags = arch._BaseArchetypeDef.flags; uint archflags = arch._BaseArchetypeDef.flags;
@ -2170,6 +2172,8 @@ namespace CodeWalker.Rendering
private Renderable GetArchetypeRenderable(Archetype arch) private Renderable GetArchetypeRenderable(Archetype arch)
{ {
if (arch == null) return null;
Renderable rndbl = null; Renderable rndbl = null;
if (!ArchetypeRenderables.TryGetValue(arch, out rndbl)) if (!ArchetypeRenderables.TryGetValue(arch, out rndbl))
{ {