diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 99b83ceae..0ec7c1381 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -6750,7 +6750,7 @@ bool FxStructMember::RequestAddress(FCompileContext &ctx, bool *writable) if (ctx.Function) { outerflags = ctx.Function->Variants[0].Flags; - if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) + if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags)); } FScopeBarrier scopeBarrier(outerflags, FScopeBarrier::FlagsFromSide(BarrierSide), ""); @@ -6794,7 +6794,7 @@ FxExpression *FxStructMember::Resolve(FCompileContext &ctx) if (ctx.Function) { outerflags = ctx.Function->Variants[0].Flags; - if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) + if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags)); } FScopeBarrier scopeBarrier(outerflags, membervar->Flags, membervar->SymbolName.GetChars()); @@ -8065,7 +8065,7 @@ isresolved: if (ctx.Function) { outerflags = ctx.Function->Variants[0].Flags; - if ((outerflags & (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) + if (((outerflags & (VARF_VirtualScope | VARF_Virtual)) == (VARF_VirtualScope | VARF_Virtual)) && ctx.Class) outerflags = FScopeBarrier::FlagsFromSide(FScopeBarrier::SideFromObjectFlags(ctx.Class->ObjectFlags)); } int innerflags = afd->Variants[0].Flags; diff --git a/src/scripting/vm/vm.h b/src/scripting/vm/vm.h index ba1db7aa9..b13f17777 100644 --- a/src/scripting/vm/vm.h +++ b/src/scripting/vm/vm.h @@ -708,7 +708,7 @@ public: bool Final = false; // cannot be overridden bool Unsafe = false; // Contains references to class fields that are unsafe for psp and item state calls. bool FuncConst = false; // [ZZ] readonly function - int BarrierSide = -1; // [ZZ] FScopeBarrier::Side + int BarrierSide = 0; // [ZZ] FScopeBarrier::Side BYTE ImplicitArgs = 0; // either 0 for static, 1 for method or 3 for action unsigned VirtualIndex = ~0u; FName Name; diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index c19d14b1e..0cfd2d66a 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -1081,8 +1081,8 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray &Fiel // For structs only allow 'deprecated', for classes exclude function qualifiers. int notallowed = forstruct? - ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Meta | ZCC_Extension : - ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension; + ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Meta | ZCC_Extension | ZCC_VirtualScope : + ZCC_Latent | ZCC_Final | ZCC_Action | ZCC_Static | ZCC_FuncConst | ZCC_Abstract | ZCC_Virtual | ZCC_Override | ZCC_Extension | ZCC_VirtualScope; if (field->Flags & notallowed) { @@ -1102,11 +1102,11 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray &Fiel if (type->ObjectFlags & OF_Play) varflags |= VARF_Play; if (field->Flags & ZCC_UIFlag) - varflags = (varflags&~VARF_Play) | VARF_UI; + varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_UI); if (field->Flags & ZCC_Play) - varflags = (varflags&~VARF_UI) | VARF_Play; + varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_Play); if (field->Flags & ZCC_ClearScope) - varflags = (varflags&~(VARF_UI | VARF_Play)); + varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_PlainData); if (field->Flags & ZCC_Native) { @@ -2128,7 +2128,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool if (c->Type()->ObjectFlags & OF_Play) varflags |= VARF_Play; if (f->Flags & ZCC_FuncConst) - varflags = (varflags&~(VARF_Play | VARF_UI)); // const implies clearscope. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag. + varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_PlainData); // const implies clearscope. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag. if (f->Flags & ZCC_UIFlag) varflags = FScopeBarrier::ChangeSideInFlags(varflags, FScopeBarrier::Side_UI); if (f->Flags & ZCC_Play) diff --git a/wadsrc/static/zscript/inventory/inventory.txt b/wadsrc/static/zscript/inventory/inventory.txt index 28b20cdd5..f24a2de09 100644 --- a/wadsrc/static/zscript/inventory/inventory.txt +++ b/wadsrc/static/zscript/inventory/inventory.txt @@ -813,7 +813,7 @@ class Inventory : Actor native // //=========================================================================== - virtual bool DrawPowerup(int x, int y) { return false; } + virtual ui bool DrawPowerup(int x, int y) { return false; } //=========================================================================== // diff --git a/wadsrc/static/zscript/inventory/powerups.txt b/wadsrc/static/zscript/inventory/powerups.txt index d355a5e14..df0812355 100644 --- a/wadsrc/static/zscript/inventory/powerups.txt +++ b/wadsrc/static/zscript/inventory/powerups.txt @@ -934,7 +934,7 @@ class PowerFlight : Powerup +INVENTORY.HUBPOWER } - bool HitCenterFrame; + ui bool HitCenterFrame; //=========================================================================== //