From a27ab73f3352c1c5eddd21d8a55d35d175c9402b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 5 Apr 2017 13:43:49 +0300 Subject: [PATCH] Fixed broken dialogue customization in USDF parser https://mantis.zdoom.org/view.php?id=539 --- src/p_usdf.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index 3d2c2e010..015dd9793 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -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: