diff --git a/src/namedef.h b/src/namedef.h index 39ea3c7836..6d85e82294 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -1072,4 +1072,4 @@ xx(SpotOuterAngle) xx(lightflags) xx(lighttype) xx(InternalDynamicLight) -xx(_a_chase_default) \ No newline at end of file +xx(_a_chase_default) diff --git a/src/sc_man.h b/src/sc_man.h index 8b3d02f122..054579b61e 100644 --- a/src/sc_man.h +++ b/src/sc_man.h @@ -164,7 +164,7 @@ struct FScriptPosition static int ErrorCounter; static bool StrictErrors; static bool errorout; - FString FileName; + FName FileName; int ScriptLine; FScriptPosition() diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 02aadc01fa..aaf339c685 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -6114,6 +6114,15 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx) // internally defined global variable ScriptPosition.Message(MSG_DEBUGLOG, "Resolving name '%s' as global variable\n", Identifier.GetChars()); + + if ((vsym->Flags & VARF_Deprecated)) + { + if (sym->mVersion <= ctx.Version) + { + ScriptPosition.Message(MSG_WARNING, "Accessing deprecated global variable %s - deprecated since %d.%d.%d", sym->SymbolName.GetChars(), vsym->mVersion.major, vsym->mVersion.minor, vsym->mVersion.revision); + } + } + newex = new FxGlobalVariable(static_cast(sym), ScriptPosition); goto foundit; } @@ -6201,9 +6210,12 @@ FxExpression *FxIdentifier::ResolveMember(FCompileContext &ctx, PContainerType * object = nullptr; return nullptr; } - if ((vsym->Flags & VARF_Deprecated) && sym->mVersion <= ctx.Version) + if ((vsym->Flags & VARF_Deprecated)) { - ScriptPosition.Message(MSG_WARNING, "Accessing deprecated member variable %s - deprecated since %d.%d.%d", sym->SymbolName.GetChars(), vsym->mVersion.major, vsym->mVersion.minor, vsym->mVersion.revision); + if (sym->mVersion <= ctx.Version) + { + ScriptPosition.Message(MSG_WARNING, "Accessing deprecated member variable %s - deprecated since %d.%d.%d", sym->SymbolName.GetChars(), vsym->mVersion.major, vsym->mVersion.minor, vsym->mVersion.revision); + } } // We have 4 cases to consider here: @@ -8625,6 +8637,7 @@ ExpEmit FxActionSpecialCall::Emit(VMFunctionBuilder *build) emitters.AddParameterIntConst(abs(Special)); // pass special number emitters.AddParameter(build, Self); + for (; i < ArgList.Size(); ++i) { FxExpression *argex = ArgList[i]; @@ -8711,9 +8724,12 @@ bool FxVMFunctionCall::CheckAccessibility(const VersionInfo &ver) ScriptPosition.Message(MSG_ERROR, "%s not accessible to %s", Function->SymbolName.GetChars(), VersionString.GetChars()); return false; } - if ((Function->Variants[0].Flags & VARF_Deprecated) && Function->mVersion <= ver) + if ((Function->Variants[0].Flags & VARF_Deprecated)) { - ScriptPosition.Message(MSG_WARNING, "Accessing deprecated function %s - deprecated since %d.%d.%d", Function->SymbolName.GetChars(), Function->mVersion.major, Function->mVersion.minor, Function->mVersion.revision); + if (Function->mVersion <= ver) + { + ScriptPosition.Message(MSG_WARNING, "Accessing deprecated function %s - deprecated since %d.%d.%d", Function->SymbolName.GetChars(), Function->mVersion.major, Function->mVersion.minor, Function->mVersion.revision); + } } return true; } diff --git a/src/scripting/zscript/zcc_compile.cpp b/src/scripting/zscript/zcc_compile.cpp index 6174522cf3..7d9ff78d86 100644 --- a/src/scripting/zscript/zcc_compile.cpp +++ b/src/scripting/zscript/zcc_compile.cpp @@ -1348,13 +1348,18 @@ bool ZCCCompiler::CompileFields(PContainerType *type, TArrayBitValue != 0) thisfieldtype = fd->FieldSize == 1 ? TypeUInt8 : fd->FieldSize == 2 ? TypeUInt16 : TypeUInt32; - PField *field = Create(name->Name, thisfieldtype, varflags | VARF_Native | VARF_Static, fd->FieldOffset, fd->BitValue); + PField *f = Create(name->Name, thisfieldtype, varflags | VARF_Native | VARF_Static, fd->FieldOffset, fd->BitValue); + if (f->Flags & (ZCC_Version | ZCC_Deprecated)) + { + f->mVersion = field->Version; + } - if (OutNamespace->Symbols.AddSymbol(field) == nullptr) + if (OutNamespace->Symbols.AddSymbol(f) == nullptr) { // name is already in use - field->Destroy(); + f->Destroy(); return false; } } diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index fe1c994ebb..20465de882 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -615,7 +615,6 @@ void DInterBackground::drawBackground(int state, bool drawsplat, bool snl_pointe for (i = 0; itype & ANIM_CONDITION) {