From fb4d4e1382e51575a42a1517391510d4059260b1 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 27 Nov 2022 14:27:27 -0500 Subject: [PATCH] [Quest API] Fix Perl EVENT_HP double parsing in Spire. (#2585) This condition caused the variables to show twice due to the way Sprie parses the source code, and the condition itself is unnecessary since we can just use an inline ternary in this case. --- zone/embparser.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 8b7842674..71d83b775 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -1588,14 +1588,8 @@ void PerlembParser::ExportEventVariables( } case EVENT_HP: { - if (extradata == 1) { - ExportVar(package_name.c_str(), "hpevent", "-1"); - ExportVar(package_name.c_str(), "inchpevent", data); - } - else { - ExportVar(package_name.c_str(), "hpevent", data); - ExportVar(package_name.c_str(), "inchpevent", "-1"); - } + ExportVar(package_name.c_str(), "hpevent", extradata ? "-1" : data); + ExportVar(package_name.c_str(), "inchpevent", extradata ? data : "-1"); break; }