From e6d23228e53f185395309982e567e51b20a12120 Mon Sep 17 00:00:00 2001 From: Arthur Ice Date: Sun, 30 Nov 2014 15:58:44 -0800 Subject: [PATCH] GetSpawnPointX(), GetSpawnPointY(), GetSpawnPointZ(), and GetSpawnPointH(), converted to GetSpawnPoint() --- zone/lua_npc.cpp | 3 ++- zone/npc.h | 4 ++-- zone/perl_npc.cpp | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/zone/lua_npc.cpp b/zone/lua_npc.cpp index 8e04a9ae6..95ae4c5c9 100644 --- a/zone/lua_npc.cpp +++ b/zone/lua_npc.cpp @@ -269,7 +269,8 @@ void Lua_NPC::PauseWandering(int pause_time) { void Lua_NPC::MoveTo(float x, float y, float z, float h, bool save) { Lua_Safe_Call_Void(); - self->MoveTo(x, y, z, h, save); + auto position = xyz_heading(x, y, z, h); + self->MoveTo(position, save); } void Lua_NPC::NextGuardPosition() { diff --git a/zone/npc.h b/zone/npc.h index 4491d5e6c..dde3ebf2a 100644 --- a/zone/npc.h +++ b/zone/npc.h @@ -281,8 +281,8 @@ public: void StopWandering(); void ResumeWandering(); void PauseWandering(int pausetime); - void MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot); - void GetClosestWaypoint(std::list &wp_list, int count, const xyz_location& location ); + void MoveTo(const xyz_heading& position, bool saveguardspot); + void GetClosestWaypoint(std::list &wp_list, int count, const xyz_location& location); uint32 GetEquipment(uint8 material_slot) const; // returns item id int32 GetEquipmentMaterial(uint8 material_slot) const; diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index f12f97d26..330e21283 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -1345,7 +1345,8 @@ XS(XS_NPC_MoveTo) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->MoveTo(mtx, mty, mtz, mth, saveguard); + auto position = xyz_heading(mtx, mty, mtz, mth); + THIS->MoveTo(position, saveguard); } XSRETURN_EMPTY; }