the MISSILE(EVEN)MORE flags still need to be accessible by ZScript for backwards compatibility.

Since these do not exist anymore an internal interface to Handle/CheckDeprecatedFlags was added.
This commit is contained in:
Christoph Oelckers 2024-10-03 12:32:09 +02:00
commit 3798fd815f
5 changed files with 185 additions and 98 deletions

View file

@ -920,6 +920,18 @@ void SynthesizeFlagFields()
{
cls->VMType->AddNativeField(FStringf("b%s", fl.Defs[i].name), (fl.Defs[i].fieldsize == 4 ? TypeSInt32 : TypeSInt16), fl.Defs[i].structoffset, fl.Defs[i].varflags, fl.Defs[i].flagbit);
}
else if (fl.Defs[i].flagbit == DEPF_MISSILEMORE || fl.Defs[i].flagbit == DEPF_MISSILEEVENMORE) // these need script side emulation because they have been around for many years.
{
auto field = cls->VMType->AddNativeField(FStringf("b%s", fl.Defs[i].name), TypeSInt32, 0, VARF_Native);
if (field)
{
// these are deprecated so flag accordingly with a proper message.
field->DeprecationMessage = "Use missilechancemult property instead";
field->mVersion = MakeVersion(4, 13, 0);
field->Flags |= VARF_Deprecated;
field->BitValue = fl.Defs[i].flagbit + 64;
}
}
}
}
}