[Bug Fix] quest::MovePCInstance() Arguments Fix. (#2020)

- Logic made the method return an "error" when not using last parameter.
This commit is contained in:
Kinglykrab
2022-02-27 16:39:45 -05:00
committed by GitHub
parent 9f0989ee2d
commit 58fafd0f9c
+6 -6
View File
@@ -3351,18 +3351,18 @@ XS(XS__MovePCInstance) {
Perl_croak(aTHX_ "Usage: quest::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, [float heading])"); 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 zone_id = (int) SvIV(ST(0));
int instanceid = (int) SvIV(ST(1)); int instance_id = (int) SvIV(ST(1));
float x = (float) SvNV(ST(2)); float x = (float) SvNV(ST(2));
float y = (float) SvNV(ST(3)); float y = (float) SvNV(ST(3));
float z = (float) SvNV(ST(4)); float z = (float) SvNV(ST(4));
float heading = 0.0f;
if (items == 4) { if (items == 6) {
quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, 0.0f)); heading = (float) SvNV(ST(5));
} else {
float heading = (float) SvNV(ST(5));
quest_manager.MovePCInstance(zone_id, instanceid, glm::vec4(x, y, z, heading));
} }
quest_manager.MovePCInstance(zone_id, instance_id, glm::vec4(x, y, z, heading));
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }