1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00

fix unsetflag on warp;

This commit is contained in:
Alice Ogeda 2023-02-10 14:17:33 -03:00
parent 88f8c7c19a
commit b049c0aa1c

View file

@ -80,6 +80,8 @@ void WarpMgr::requestWarp( Entity::Player& player, Common::WarpType warpType, Co
void WarpMgr::finishWarp( Entity::Player& player ) void WarpMgr::finishWarp( Entity::Player& player )
{ {
auto& playerMgr = Common::Service< PlayerMgr >::ref();
WarpType warpType = WarpType::WARP_TYPE_NORMAL; WarpType warpType = WarpType::WARP_TYPE_NORMAL;
auto it = m_entityIdToWarpInfoMap.find( player.getId() ); auto it = m_entityIdToWarpInfoMap.find( player.getId() );
if( it != m_entityIdToWarpInfoMap.end() ) if( it != m_entityIdToWarpInfoMap.end() )
@ -100,19 +102,19 @@ void WarpMgr::finishWarp( Entity::Player& player )
} }
auto zoneInPacket = makeActorControlSelf( player.getId(), Appear, warpType, 0, 0, 0 ); auto zoneInPacket = makeActorControlSelf( player.getId(), Appear, warpType, 0, 0, 0 );
auto SetStatusPacket = makeActorControl( player.getId(), SetStatus, static_cast< uint8_t >( Common::ActorStatus::Idle ) ); auto setStatusPacket = makeActorControl( player.getId(), SetStatus, static_cast< uint8_t >( Common::ActorStatus::Idle ) );
player.setZoningType( Common::ZoningType::None ); player.setZoningType( Common::ZoningType::None );
if( !player.getGmInvis() ) if( !player.getGmInvis() )
player.sendToInRangeSet( zoneInPacket ); player.sendToInRangeSet( zoneInPacket );
player.sendToInRangeSet( SetStatusPacket, true ); player.sendToInRangeSet( setStatusPacket, true );
auto& server = Common::Service< WorldServer >::ref(); auto& server = Common::Service< WorldServer >::ref();
server.queueForPlayer( player.getCharacterId(), zoneInPacket ); server.queueForPlayer( player.getCharacterId(), zoneInPacket );
player.unsetStateFlag( PlayerStateFlag::BetweenAreas ); playerMgr.onUnsetStateFlag( player, PlayerStateFlag::BetweenAreas );
} }
@ -120,7 +122,6 @@ void WarpMgr::requestPlayerTeleport( Entity::Player& player, uint16_t aetheryteI
{ {
auto& exdData = Common::Service< Data::ExdData >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref();
auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto& teriMgr = Common::Service< TerritoryMgr >::ref();
auto& warpMgr = Common::Service< WarpMgr >::ref();
auto aetherData = exdData.getRow< Excel::Aetheryte >( aetheryteId ); auto aetherData = exdData.getRow< Excel::Aetheryte >( aetheryteId );
@ -172,17 +173,18 @@ void WarpMgr::requestPlayerTeleport( Entity::Player& player, uint16_t aetheryteI
} }
else if( teleportType == 4 ) // return else if( teleportType == 4 ) // return
{ {
warpType = WarpType::WARP_TYPE_HOME_POINT; warpType = WarpType::WARP_TYPE_REISE;
player.setZoningType( Common::ZoningType::ReturnDead ); player.setZoningType( Common::ZoningType::ReturnDead );
} }
if( sameTerritory ) if( sameTerritory )
warpMgr.requestWarp( player, warpType, pos, rot ); requestWarp( player, warpType, pos, rot );
else else
{ {
auto pTeri = teriMgr.getZoneByTerritoryTypeId( data.TerritoryType ); auto pTeri = teriMgr.getZoneByTerritoryTypeId( data.TerritoryType );
if( !pTeri ) if( !pTeri )
return; return;
warpMgr.requestMoveTerritory( player, warpType, pTeri->getGuId(), pos, rot );
requestMoveTerritory( player, warpType, pTeri->getGuId(), pos, rot );
} }
} }