diff options
author | andybarcia <andybarcia4@gmail.com> | 2021-02-16 14:46:20 +0100 |
---|---|---|
committer | andybarcia <andybarcia4@gmail.com> | 2021-02-16 14:57:40 +0100 |
commit | f455f873c7902bd7378c6320ee39a0bad323186c (patch) | |
tree | 5bd49b2c8b215180f602c423d2ff71b3d6c488ae | |
parent | cb64f2d96ba25f516ecd6dfb3e80b7ddbb13971f (diff) |
Fixes crash when calling VisualShader::set_mode
-rw-r--r-- | scene/resources/visual_shader.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 438e130cf4..a296156bf5 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -675,6 +675,8 @@ void VisualShader::get_node_connections(Type p_type, List<Connection> *r_connect } void VisualShader::set_mode(Mode p_mode) { + ERR_FAIL_INDEX_MSG(p_mode, Mode::MODE_MAX, vformat("Invalid shader mode: %d.", p_mode)); + if (shader_mode == p_mode) { return; } |