Browse Source

Fix terrain being reloaded after a scene modification

ShiroSmith 5 years ago
parent
commit
5c00b4daee
1 changed files with 5 additions and 0 deletions
  1. 5 0
      hrt/prefab/terrain/Terrain.hx

+ 5 - 0
hrt/prefab/terrain/Terrain.hx

@@ -274,6 +274,11 @@ class Terrain extends Object3D {
 	}
 
 	public function initTerrain( ctx : Context, height = true, surface = true ) {
+
+		// Fix terrain being reloaded after a scene modification
+		if( terrain.surfaceArray != null )
+			return;
+
 		//#if editor
 		if( surface ) {
 			var initDone = false;