1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-07 19:27:45 +00:00

Removed old function for performZoning

This commit is contained in:
Mordred 2022-01-30 15:37:24 +01:00
parent 0838881a5b
commit bfdf732579
3 changed files with 9 additions and 33 deletions

View file

@ -477,33 +477,6 @@ void Sapphire::Entity::Player::forceZoneing( uint32_t zoneId )
warpMgr.requestMoveTerritory( *this, WarpType::WARP_TYPE_NORMAL, pTeri->getGuId(), getPos(), getRot() );
}
void Sapphire::Entity::Player::performZoning( uint16_t territoryTypeId, uint32_t territoryId, const Common::FFXIVARR_POSITION3& pos, float rotation )
{
m_pos = pos;
setRot( rotation );
auto& teriMgr = Common::Service< TerritoryMgr >::ref();
setOnEnterEventDone( false );
TerritoryPtr pZone;
if( territoryId != 0 )
pZone = teriMgr.getTerritoryByGuId( territoryId );
else
pZone = teriMgr.getZoneByTerritoryTypeId( territoryTypeId );
if( !teriMgr.movePlayer( pZone, *this ) )
{
// todo: this will require proper handling, for now just return the player to their previous area
m_pos = m_prevPos;
m_rot = m_prevRot;
m_territoryTypeId = m_prevTerritoryTypeId;
auto pZone1 = teriMgr.getZoneByTerritoryTypeId( m_territoryTypeId );
if( !teriMgr.movePlayer( pZone1, *this ) )
return;
}
}
bool Sapphire::Entity::Player::exitInstance()
{
auto& teriMgr = Common::Service< TerritoryMgr >::ref();

View file

@ -562,9 +562,6 @@ namespace Sapphire::Entity
/*! set the loading complete bool */
void setLoadingComplete( bool bComplete );
/*! mark this player for zoning, notify worldserver */
void performZoning( uint16_t territoryTypeId, uint32_t territoryId, const Common::FFXIVARR_POSITION3& pos, float rotation );
void sendZoneInPackets( uint32_t param1, bool pSetStatus );
void finishZoning();

View file

@ -195,7 +195,12 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
case GmCommand::Call:
{
if( targetPlayer->getTerritoryTypeId() != player.getTerritoryTypeId() )
targetPlayer->performZoning( player.getTerritoryTypeId(), player.getTerritoryId(), { player.getPos().x, player.getPos().y, player.getPos().z }, player.getRot() );
{
auto& warpMgr = Common::Service< WarpMgr >::ref();
warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM,
player.getTerritoryId(), { player.getPos().x, player.getPos().y, player.getPos().z },
player.getRot() );
}
else
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() );
PlayerMgr::sendServerNotice( player, "Calling {0}", targetPlayer->getName() );
@ -533,8 +538,9 @@ void Sapphire::Network::GameConnection::gmCommandHandler( const Packets::FFXIVAR
}
else
{
targetPlayer->setPos( targetPlayer->getPos() );
targetPlayer->performZoning( static_cast< uint16_t >( param1 ), targetPlayer->getTerritoryId(), targetPlayer->getPos(), 0 );
auto& warpMgr = Common::Service< WarpMgr >::ref();
warpMgr.requestMoveTerritory( *targetPlayer, WarpType::WARP_TYPE_GM,
targetPlayer->getTerritoryId(), targetPlayer->getPos(), 0 );
}
PlayerMgr::sendServerNotice( player, "{0} was warped to zone {1}", targetPlayer->getName(), param1, pZone->getName() );