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

return players to last zone if the instance doesnt exist

This commit is contained in:
Adam 2018-01-29 20:41:24 +11:00
parent 0d0db3b41c
commit 1550414983

View file

@ -366,7 +366,15 @@ void Core::Entity::Player::returnToHomepoint()
void Core::Entity::Player::setZone( uint32_t zoneId ) void Core::Entity::Player::setZone( uint32_t zoneId )
{ {
if( !g_territoryMgr.movePlayer( zoneId, getAsPlayer() ) ) if( !g_territoryMgr.movePlayer( zoneId, getAsPlayer() ) )
return; {
// 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_zoneId = m_prevZoneId;
if( !g_territoryMgr.movePlayer( m_zoneId, getAsPlayer() ) )
return;
}
sendZonePackets(); sendZonePackets();
} }