Fixed broken dialogue customization in USDF parser

https://mantis.zdoom.org/view.php?id=539
This commit is contained in:
alexey.lysiuk 2017-04-05 13:43:49 +03:00
parent dd30d2a045
commit a27ab73f33

View file

@ -72,8 +72,13 @@ class USDFParser : public UDMFParserBase
}
type = cls;
}
if (type && type->IsDescendantOf(RUNTIME_CLASS(AInventory))) return type;
return nullptr;
return type;
}
PClassActor *CheckInventoryActorType(const char *key)
{
PClassActor* const type = CheckActorType(key);
return nullptr != type && type->IsDescendantOf(RUNTIME_CLASS(AInventory)) ? type : nullptr;
}
//===========================================================================
@ -94,7 +99,7 @@ class USDFParser : public UDMFParserBase
switch(key)
{
case NAME_Item:
check.Item = CheckActorType(key);
check.Item = CheckInventoryActorType(key);
break;
case NAME_Amount:
@ -273,7 +278,7 @@ class USDFParser : public UDMFParserBase
switch(key)
{
case NAME_Item:
check.Item = CheckActorType(key);
check.Item = CheckInventoryActorType(key);
break;
case NAME_Count: