diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 8f55f39e064..9f52222ac55 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -5608,6 +5608,10 @@ Error ShaderLanguage::_parse_shader(const Map &p_funct tk = _get_token(); if (tk.type == TK_IDENTIFIER) { st.name = tk.text; + if (shader->structs.has(st.name)) { + _set_error("Redefinition of '" + String(st.name) + "'"); + return ERR_PARSE_ERROR; + } tk = _get_token(); if (tk.type != TK_CURLY_BRACKET_OPEN) { _set_error("Expected '{'");