Explorar o código

bugfix if no parent

Nicolas Cannasse %!s(int64=4) %!d(string=hai) anos
pai
achega
8a9d89a21f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      hrt/prefab/Reference.hx

+ 1 - 1
hrt/prefab/Reference.hx

@@ -72,7 +72,7 @@ class Reference extends Object3D {
 		var p = resolveRef(ctx.shared);
 		var p = resolveRef(ctx.shared);
 		if(p == null)
 		if(p == null)
 			return;
 			return;
-		var parentCtx = ctx.shared.contexts.get(parent);
+		var parentCtx = parent == null ? null : ctx.shared.contexts.get(parent);
 		if(parentCtx == null || parentCtx.local3d != ctx.local3d) {
 		if(parentCtx == null || parentCtx.local3d != ctx.local3d) {
 			// Only apply reference Object3D properties (pos, scale...) to own local3D
 			// Only apply reference Object3D properties (pos, scale...) to own local3D
 			// Not all refs will create their own scene object
 			// Not all refs will create their own scene object