summaryrefslogtreecommitdiffstats
path: root/core/variant.h
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-09-18 20:02:47 +0200
committerHein-Pieter van Braam <hp@tmm.cx>2017-09-19 18:55:31 +0200
commit833c3917b247baa46f5a5f6ad6ce478cffc1911d (patch)
tree0f25e4584f1da4b0534c55c9b6f88e0358d8dd98 /core/variant.h
parent85641c545bedbdb703ad923306786afe5c312110 (diff)
downloadredot-engine-833c3917b247baa46f5a5f6ad6ce478cffc1911d.tar.gz
Allow booleanization of all types
We now allow booleanization of all types. This means that empty versions of all types now evaluate to false. So a Vector2(0,0), Dictionary(), etc. This allows you to write GDScript like: if not Dictionary(): print("Empty dict") Booleanization can now also no longer fail. There is no more valid flag, this changes Variant and GDNative API.
Diffstat (limited to 'core/variant.h')
-rw-r--r--core/variant.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/variant.h b/core/variant.h
index edc86dedd4..5ea540a63f 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -390,7 +390,7 @@ public:
uint32_t hash() const;
bool hash_compare(const Variant &p_variant) const;
- bool booleanize(bool &valid) const;
+ bool booleanize() const;
void static_assign(const Variant &p_variant);
static void get_constructor_list(Variant::Type p_type, List<MethodInfo> *p_list);