From 58fafd0f9ca8d6d6aca7685a5d869cf9bd731732 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 27 Feb 2022 16:39:45 -0500 Subject: [PATCH] [Bug Fix] quest::MovePCInstance() Arguments Fix. (#2020) - Logic made the method return an "error" when not using last parameter. --- zone/embparser_api.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 04a8654f1..db814234b 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3350,19 +3350,19 @@ XS(XS__MovePCInstance) { if (items != 5 && items != 6) Perl_croak(aTHX_ "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); - int zone_id = (int) SvIV(ST(0)); - int instanceid = (int) SvIV(ST(1)); - float x = (float) SvNV(ST(2)); - float y = (float) SvNV(ST(3)); - float z = (float) SvNV(ST(4)); + int zone_id = (int) SvIV(ST(0)); + int instance_id = (int) SvIV(ST(1)); + float x = (float) SvNV(ST(2)); + float y = (float) SvNV(ST(3)); + float z = (float) SvNV(ST(4)); + float heading = 0.0f; - if (items == 4) { - quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, 0.0f)); - } else { - float heading = (float) SvNV(ST(5)); - quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, heading)); + if (items == 6) { + heading = (float) SvNV(ST(5)); } + quest_manager.MovePCInstance(zone_id, instance_id, glm::vec4(x, y, z, heading)); + XSRETURN_EMPTY; }