From 01e5441d62a4b729f3ff794e05c6341e3cbf8e05 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 1 Sep 2019 17:10:03 +0200 Subject: [PATCH] Make nil equivalent type to string and userdata --- src/ScriptTypes/ScriptType.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ScriptTypes/ScriptType.hpp b/src/ScriptTypes/ScriptType.hpp index 7a3c3dd..764d54c 100644 --- a/src/ScriptTypes/ScriptType.hpp +++ b/src/ScriptTypes/ScriptType.hpp @@ -42,6 +42,11 @@ namespace Porygon{ } virtual bool operator ==(const shared_ptr& b) const{ + if (_class == TypeClass::Nil){ + auto bClass = b->_class; + if (bClass == TypeClass::UserData || bClass == TypeClass::String || bClass == TypeClass::All) + return true; + } return _class == b->_class; }