From 8cae275bf4eaaccca0176d4bdcaeeb65667b5103 Mon Sep 17 00:00:00 2001 From: Ramesh Ravone Date: Fri, 22 Sep 2017 11:33:54 +0530 Subject: [PATCH] Fix booleanize closes #35 --- include/core/Variant.hpp | 2 +- src/core/Variant.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/core/Variant.hpp b/include/core/Variant.hpp index 6d9b1a71..8910df6b 100644 --- a/include/core/Variant.hpp +++ b/include/core/Variant.hpp @@ -259,7 +259,7 @@ public: bool hash_compare(const Variant& b) const; - bool booleanize(bool &valid) const; + bool booleanize() const; ~Variant(); diff --git a/src/core/Variant.cpp b/src/core/Variant.cpp index fa72b669..de500b09 100644 --- a/src/core/Variant.cpp +++ b/src/core/Variant.cpp @@ -199,9 +199,7 @@ Variant &Variant::operator =(const Variant& v) Variant::operator bool() const { - bool valid = false; - bool result = booleanize(valid); - return valid && result; + return booleanize(); } Variant::operator signed int() const { @@ -423,9 +421,9 @@ bool Variant::hash_compare(const Variant& b) const return godot_variant_hash_compare(&_godot_variant, &b._godot_variant); } -bool Variant::booleanize(bool &valid) const +bool Variant::booleanize() const { - return godot_variant_booleanize(&_godot_variant, &valid); + return godot_variant_booleanize(&_godot_variant); } Variant::~Variant()