From 0c53718e7badb163711fbfaf0300ecba4ef4a703 Mon Sep 17 00:00:00 2001 From: SkyJJ Date: Sun, 23 Feb 2020 02:23:27 +0100 Subject: [PATCH] Add abort mechanism when invoking EditorNavigationMeshGenerator::bake in-game --- modules/recast/navigation_mesh_generator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/recast/navigation_mesh_generator.cpp b/modules/recast/navigation_mesh_generator.cpp index c67136b814a..8c01d911175 100644 --- a/modules/recast/navigation_mesh_generator.cpp +++ b/modules/recast/navigation_mesh_generator.cpp @@ -433,6 +433,11 @@ EditorNavigationMeshGenerator::~EditorNavigationMeshGenerator() { void EditorNavigationMeshGenerator::bake(Ref p_nav_mesh, Node *p_node) { + if (!Engine::get_singleton()->is_editor_hint()) { + ERR_PRINTS("Invoking EditorNavigationMeshGenerator::bake(...) in-game is not supported in Godot 3.2 or below. Aborting bake..."); + return; + } + ERR_FAIL_COND(!p_nav_mesh.is_valid()); EditorProgress ep("bake", TTR("Navigation Mesh Generator Setup:"), 11);