summaryrefslogtreecommitdiff
path: root/core/method_bind.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/method_bind.h')
-rw-r--r--core/method_bind.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/method_bind.h b/core/method_bind.h
index 7f3da9c25e..ff2c771f81 100644
--- a/core/method_bind.h
+++ b/core/method_bind.h
@@ -157,8 +157,9 @@ struct VariantObjectClassChecker<Control *> {
#define CHECK_NOARG(m_arg) \
{ \
if (p_arg##m_arg.get_type() != Variant::NIL) { \
- if (r_argerror) \
+ if (r_argerror) { \
*r_argerror = (m_arg - 1); \
+ } \
return CALL_ERROR_EXTRA_ARGUMENT; \
} \
}
@@ -230,19 +231,21 @@ public:
_FORCE_INLINE_ Variant has_default_argument(int p_arg) const {
int idx = argument_count - p_arg - 1;
- if (idx < 0 || idx >= default_arguments.size())
+ if (idx < 0 || idx >= default_arguments.size()) {
return false;
- else
+ } else {
return true;
+ }
}
_FORCE_INLINE_ Variant get_default_argument(int p_arg) const {
int idx = argument_count - p_arg - 1;
- if (idx < 0 || idx >= default_arguments.size())
+ if (idx < 0 || idx >= default_arguments.size()) {
return Variant();
- else
+ } else {
return default_arguments[idx];
+ }
}
#ifdef DEBUG_METHODS_ENABLED