- allow specifying specials in ZSDF by name.

- allow specifying a decal ID by name in UDMF.
This commit is contained in:
Christoph Oelckers 2017-02-26 17:05:04 +01:00
parent ee6e427e78
commit f31ddbc57c
4 changed files with 20 additions and 3 deletions

View File

@ -92,6 +92,8 @@ conversation // Starts a dialog.
choice
{
specialname = <string>; // Allows specifying a special by name.
// The amount of an item needed for this option to become available.
// You can have as many as needed. All require blocks must be satisfied
// to show this option.

View File

@ -751,14 +751,23 @@ IMPLEMENT_CLASS(ADecal, false, false)
void ADecal::BeginPlay ()
{
const FDecalTemplate *tpl;
const FDecalTemplate *tpl = nullptr;
Super::BeginPlay ();
if (args[0] < 0)
{
FName name = ENamedName(-args[0]);
tpl = DecalLibrary.GetDecalByName(name.GetChars());
}
else
{
int decalid = args[0] + (args[1] << 8); // [KS] High byte for decals.
tpl = DecalLibrary.GetDecalByNum(decalid);
}
// If no decal is specified, don't try to create one.
if (decalid != 0 && (tpl = DecalLibrary.GetDecalByNum (decalid)) != 0)
if (tpl != nullptr)
{
if (!tpl->PicNum.Exists())
{

View File

@ -360,6 +360,7 @@ xx(CeilingZ)
xx(FloorZ)
xx(Health)
xx(Pitch)
xx(SpecialName)
xx(Special)
xx(TID)
xx(TIDtoHate)

View File

@ -196,6 +196,11 @@ class USDFParser : public UDMFParserBase
reply->ActionSpecial = 0;
break;
case NAME_SpecialName:
if (namespace_bits == Zd)
reply->ActionSpecial = P_FindLineSpecial(CheckString(key));
break;
case NAME_Arg0:
case NAME_Arg1:
case NAME_Arg2: