From a83a8073f5590ddea8d407aee93a7e17fd6bbb3a Mon Sep 17 00:00:00 2001 From: Vit Date: Thu, 16 Jan 2020 14:01:45 +0300 Subject: [PATCH] Fix validate_special in DMeshSO Ensure that we receive valid DMeshAABBTree3 by getter DMeshSO.Spatial --- sceneObjects/DMeshSO.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sceneObjects/DMeshSO.cs b/sceneObjects/DMeshSO.cs index 0f7feba..cbe6940 100644 --- a/sceneObjects/DMeshSO.cs +++ b/sceneObjects/DMeshSO.cs @@ -349,7 +349,7 @@ void on_mesh_changed(bool bInvalidateSpatial = true, bool bInvalidateDecomp = tr void validate_spatial() { - if ( enable_spatial && spatial == null ) { + if (enable_spatial && (spatial == null || !spatial.IsValid)) { spatial = new DMeshAABBTree3(mesh); spatial.Build(); }