From b0889b98147612f1a4363561b763025ba76540df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Thu, 6 Mar 2025 08:59:02 -0300 Subject: [PATCH] Fix deprecation version checks on class fields/pointers --- src/common/scripting/core/symbols.cpp | 2 +- src/common/scripting/core/types.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/scripting/core/symbols.cpp b/src/common/scripting/core/symbols.cpp index d293cbbee4..7544a4561b 100644 --- a/src/common/scripting/core/symbols.cpp +++ b/src/common/scripting/core/symbols.cpp @@ -170,7 +170,7 @@ VersionInfo PField::GetVersion() { VersionInfo Highest = { 0,0,0 }; if (!(Flags & VARF_Deprecated)) Highest = mVersion; - if (Type->mVersion > Highest) Highest = Type->mVersion; + if (Type->mVersion > Highest && !Type->TypeDeprecated) Highest = Type->mVersion; return Highest; } diff --git a/src/common/scripting/core/types.cpp b/src/common/scripting/core/types.cpp index 20ce7e05dd..2715679861 100644 --- a/src/common/scripting/core/types.cpp +++ b/src/common/scripting/core/types.cpp @@ -1493,6 +1493,7 @@ PPointer::PPointer(PType *pointsat, bool isconst) { mDescriptiveName.Format("Pointer<%s%s>", pointsat->DescriptiveName(), isconst ? "readonly " : ""); mVersion = pointsat->mVersion; + TypeDeprecated = pointsat->TypeDeprecated; } else { @@ -1674,7 +1675,11 @@ PClassPointer::PClassPointer(PClass *restrict) loadOp = OP_LP; storeOp = OP_SP; Flags |= TYPE_ClassPointer; - if (restrict) mVersion = restrict->VMType->mVersion; + if (restrict) + { + mVersion = restrict->VMType->mVersion; + TypeDeprecated = restrict->VMType->TypeDeprecated; + } else mVersion = 0; }