fix node error not finding the navmesh

delete the notifying function causing the error not finding the navmesh at init, add assert error to verify navmesh exists
master
t3du 2022-01-13 22:52:21 -03:00 committed by GitHub
parent b36692fc27
commit 615bf38013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -10,14 +10,12 @@ class NavigableLocationNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
iron.Scene.active.notifyOnInit(function() {
get(0);
});
}
override function get(from: Int): Dynamic {
#if arm_navigation
// Assume navmesh exists..
assert(Error, Navigation.active.navMeshes.length > 0, "No Navigation Mesh Present");
Navigation.active.navMeshes[0].getRandomPoint(function(p: Vec4) {
loc = p;
});