From a5c8b829265c5e7112969b728ce9088d7f381b5c Mon Sep 17 00:00:00 2001 From: collett Date: Fri, 4 Dec 2020 07:46:43 +0900 Subject: [PATCH] stay compatible with original forceZoneing --- src/world/Actor/Player.cpp | 11 +++++++++++ src/world/Actor/Player.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 18a9d1d2..6380d084 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -423,6 +423,17 @@ void Sapphire::Entity::Player::forceZoneing( uint32_t zoneId, float x, float y, z = m_pos.z; r = m_rot; } + else + { + if( x == FLT_MAX ) + x = m_pos.x; + if( y == FLT_MAX ) + y = m_pos.y; + if( z == FLT_MAX ) + z = m_pos.z; + if( r == FLT_MAX ) + r = m_rot; + } Common::FFXIVARR_POSITION3 pos { x, y, z }; m_queuedZoneing = std::make_shared< QueuedZoning >( zoneId, pos, Util::getTimeMs(), r ); prepareZoning( showZoneName ? zoneId : 0, true, 1, 0 ); diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index 089413e3..7af0a9d3 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -501,7 +501,7 @@ namespace Sapphire::Entity /*! gets the players territoryTypeId */ uint32_t getTerritoryTypeId() const; - void forceZoneing( uint32_t zoneId = 0, float x = 0, float y = 0, float z = 0, float r = 0, bool showZoneName = false ); + void forceZoneing( uint32_t zoneId = 0, float x = FLT_MAX, float y = FLT_MAX, float z = FLT_MAX, float r = FLT_MAX, bool showZoneName = false ); /*! return player to preset homepoint */ void returnToHomepoint();