summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-02-23 17:52:49 -0300
committerJuan Linietsky <juan@godotengine.org>2019-02-23 17:55:09 -0300
commitfd68bb2596bff1990711862f90b4763553d2edac (patch)
tree24024f57e3b3697bd51316e97bccf323cf10a87b /servers
parent07fbc341951352c7d0b00bf4370dccb94449d37a (diff)
-Treat scalar conversions when calling functions as error, closes #24261
-Make shader editor display errors if exist when just opening it -Make ShaderMaterial not lose parameters if opened in error.
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/shader_language.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 639946916d..9a0218d5d0 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -2074,9 +2074,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
bool fail = false;
for (int i = 0; i < argcount; i++) {
- if (get_scalar_type(args[i]) == args[i] && p_func->arguments[i + 1]->type == Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode *>(p_func->arguments[i + 1]), builtin_func_defs[idx].args[i])) {
- //all good
- } else if (args[i] != builtin_func_defs[idx].args[i]) {
+ if (args[i] != builtin_func_defs[idx].args[i]) {
fail = true;
break;
}
@@ -2186,9 +2184,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
for (int j = 0; j < args.size(); j++) {
- if (get_scalar_type(args[j]) == args[j] && p_func->arguments[j + 1]->type == Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode *>(p_func->arguments[j + 1]), pfunc->arguments[j].type)) {
- //all good
- } else if (args[j] != pfunc->arguments[j].type) {
+ if (args[j] != pfunc->arguments[j].type) {
fail = true;
break;
}