diff --git a/src/modules/stream/stream.cpp b/src/modules/stream/stream.cpp index e76e152..3589197 100644 --- a/src/modules/stream/stream.cpp +++ b/src/modules/stream/stream.cpp @@ -275,6 +275,10 @@ void StreamWorld::update_items() } } +void StreamWorld::run_command(const String &command, const Array &args) +{ +} + void StreamWorld::_notification(int which) { switch (which) { @@ -285,10 +289,12 @@ void StreamWorld::_notification(int which) case NOTIFICATION_ENTER_TREE: if (initialized) { if (Engine::get_singleton()->is_editor_hint()) - current_scene = Object::cast_to( - get_tree()->get_root()); - else + current_scene = Object::cast_to(this); + else { current_scene = get_tree()->get_current_scene(); + if (current_scene) + current_scene = get_tree()->get_root(); + } ERR_FAIL_COND_MSG(!current_scene, "No current scene"); RoadProcessing::road_setup(this); set_process(true); @@ -329,6 +335,8 @@ void StreamWorld::_bind_methods() &StreamWorld::terrain_dead); ClassDB::bind_method(D_METHOD("viewer_dead"), &StreamWorld::viewer_dead); + ClassDB::bind_method(D_METHOD("run_command", "command", "args"), + &StreamWorld::run_command); } StreamWorld::StreamWorld() diff --git a/src/modules/stream/stream.h b/src/modules/stream/stream.h index 8e859fd..c0a99eb 100644 --- a/src/modules/stream/stream.h +++ b/src/modules/stream/stream.h @@ -57,6 +57,7 @@ private: void unload_building(int id); void request_item(int type, int item); void update_items(); + void run_command(const String &command, const Array &args); static void _bind_methods(); public: