Implemented 'protected' on fields and methods

This commit is contained in:
ZZYZX 2017-03-05 01:03:38 +02:00 committed by Christoph Oelckers
parent 9d4179ca06
commit b87f9b540e
2 changed files with 4 additions and 4 deletions

View file

@ -6084,7 +6084,7 @@ FxExpression *FxIdentifier::ResolveMember(FCompileContext &ctx, PStruct *classct
}
PClass* cls_ctx = dyn_cast<PClass>(classctx);
PClass* cls_target = dyn_cast<PClass>(objtype);
if ((vsym->Flags & VARF_Protected) && (!cls_ctx || !cls_target || cls_ctx->IsDescendantOf(cls_target)))
if ((vsym->Flags & VARF_Protected) && (!cls_ctx || !cls_target || !cls_ctx->IsDescendantOf(cls_target)))
{
ScriptPosition.Message(MSG_ERROR, "Protected member %s not accessible", vsym->SymbolName.GetChars());
return nullptr;