diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index b5b735583..0886854bf 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -6130,7 +6130,15 @@ FxExpression *FxIdentifier::Resolve(FCompileContext& ctx) { 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); + // Allow use of deprecated symbols in deprecated functions of the internal code. This is meant to allow deprecated code to remain as it was, + // even if it depends on some deprecated symbol. + // The main motivation here is to keep the deprecated static functions accessing the global level variable as they were. + // Print these only if debug output is active and at the highest verbosity level. + const bool internal = (ctx.Function->Variants[0].Flags & VARF_Deprecated) && Wads.GetLumpFile(ctx.Lump) == 0; + + ScriptPosition.Message(internal ? MSG_DEBUGMSG : MSG_WARNING, + "%sAccessing deprecated global variable %s - deprecated since %d.%d.%d", internal ? TEXTCOLOR_BLUE : "", + sym->SymbolName.GetChars(), vsym->mVersion.major, vsym->mVersion.minor, vsym->mVersion.revision); } }