mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 06:27:45 +00:00
return player to parent housing zone if logged out inside house
This commit is contained in:
parent
2232cdddc9
commit
87ca06cfaf
3 changed files with 28 additions and 1 deletions
|
@ -84,6 +84,17 @@ bool Sapphire::Entity::Player::load( uint32_t charId, SessionPtr pSession )
|
|||
pCurrZone = pTeriMgr->getZoneByTerritoryTypeId( zoneId );
|
||||
}
|
||||
}
|
||||
else if( pTeriMgr->isInternalEstateTerritory( zoneId ) )
|
||||
{
|
||||
// todo: this needs to go to the area just outside of the plot door
|
||||
pCurrZone = pTeriMgr->getZoneByLandSetId( m_prevTerritoryId );
|
||||
|
||||
zoneId = m_prevTerritoryTypeId;
|
||||
m_pos.x = m_prevPos.x;
|
||||
m_pos.y = m_prevPos.y;
|
||||
m_pos.z = m_prevPos.z;
|
||||
setRot( m_prevRot );
|
||||
}
|
||||
else if( pTeriMgr->isHousingTerritory( zoneId ) )
|
||||
{
|
||||
pCurrZone = pTeriMgr->getZoneByLandSetId( m_territoryId );
|
||||
|
|
|
@ -106,11 +106,20 @@ bool Sapphire::World::Manager::TerritoryMgr::isPrivateTerritory( uint32_t territ
|
|||
|
||||
return pTeri->territoryIntendedUse == TerritoryIntendedUse::OpeningArea ||
|
||||
pTeri->territoryIntendedUse == TerritoryIntendedUse::Inn ||
|
||||
pTeri->territoryIntendedUse == TerritoryIntendedUse::HousingPrivateArea ||
|
||||
pTeri->territoryIntendedUse == TerritoryIntendedUse::JailArea ||
|
||||
pTeri->territoryIntendedUse == TerritoryIntendedUse::MSQPrivateArea;
|
||||
}
|
||||
|
||||
bool Sapphire::World::Manager::TerritoryMgr::isInternalEstateTerritory( uint32_t territoryTypeId ) const
|
||||
{
|
||||
auto pTeri = getTerritoryDetail( territoryTypeId );
|
||||
|
||||
if( !pTeri )
|
||||
return false;
|
||||
|
||||
return pTeri->territoryIntendedUse == TerritoryIntendedUse::HousingPrivateArea;
|
||||
}
|
||||
|
||||
bool Sapphire::World::Manager::TerritoryMgr::isDefaultTerritory( uint32_t territoryTypeId ) const
|
||||
{
|
||||
auto pTeri = getTerritoryDetail( territoryTypeId );
|
||||
|
|
|
@ -87,6 +87,13 @@ namespace Sapphire::World::Manager
|
|||
/*! returns true if the territoryType in question is not a private zone */
|
||||
bool isPrivateTerritory( uint32_t territoryTypeId ) const;
|
||||
|
||||
/*!
|
||||
* @brief Checks if a territory type is an internal housing area
|
||||
* @param territoryTypeId The territory to test
|
||||
* @return true if it is a housing area, false if not
|
||||
*/
|
||||
bool isInternalEstateTerritory( uint32_t territoryTypeId ) const;
|
||||
|
||||
/*! returns true if the territoryType is a default non-instanced zone */
|
||||
bool isDefaultTerritory( uint32_t territoryTypeId ) const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue