diff --git a/src/UserData/UserDataScriptType.hpp b/src/UserData/UserDataScriptType.hpp index 45cd35b..d7ba5f0 100644 --- a/src/UserData/UserDataScriptType.hpp +++ b/src/UserData/UserDataScriptType.hpp @@ -84,6 +84,8 @@ namespace Porygon::UserData { if (!ud->ContainsField(hash.GetHash())) return false; auto field = _userData->Get()->GetField(hash.GetHash()); + if (!field->HasSetter()) + return false; return (val->CastableTo(field->GetType(), false) != CastResult::InvalidCast); } @@ -93,6 +95,8 @@ namespace Porygon::UserData { if (!ud->ContainsField(indexer.GetHash())) return false; auto field = _userData->Get()->GetField(indexer.GetHash()); + if (!field->HasSetter()) + return false; return (val->CastableTo(field->GetType(), false) != CastResult::InvalidCast); }