Make nil equivalent type to string and userdata
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2019-09-01 17:10:03 +02:00
parent 2fbe1fdf09
commit 01e5441d62
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,11 @@ namespace Porygon{
} }
virtual bool operator ==(const shared_ptr<const ScriptType>& b) const{ virtual bool operator ==(const shared_ptr<const ScriptType>& 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; return _class == b->_class;
} }