diff --git a/src/scripts/quest/classquest/CNJ/ClsCnj001.cpp b/src/scripts/quest/classquest/CNJ/ClsCnj001.cpp index 9749ee46..2ef78f0e 100644 --- a/src/scripts/quest/classquest/CNJ/ClsCnj001.cpp +++ b/src/scripts/quest/classquest/CNJ/ClsCnj001.cpp @@ -195,7 +195,7 @@ private: void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); diff --git a/src/scripts/quest/classquest/CNJ/ClsCnj002.cpp b/src/scripts/quest/classquest/CNJ/ClsCnj002.cpp index f7406e0b..331eb6ad 100644 --- a/src/scripts/quest/classquest/CNJ/ClsCnj002.cpp +++ b/src/scripts/quest/classquest/CNJ/ClsCnj002.cpp @@ -201,7 +201,7 @@ private: void Scene00004Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy0, 1220 /*Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); diff --git a/src/scripts/quest/classquest/CNJ/ClsCnj003.cpp b/src/scripts/quest/classquest/CNJ/ClsCnj003.cpp index 94fe59a8..fa39fd74 100644 --- a/src/scripts/quest/classquest/CNJ/ClsCnj003.cpp +++ b/src/scripts/quest/classquest/CNJ/ClsCnj003.cpp @@ -287,7 +287,7 @@ private: void Scene00002Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy0, 319 /*Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); diff --git a/src/scripts/quest/classquest/CNJ/ClsCnj004.cpp b/src/scripts/quest/classquest/CNJ/ClsCnj004.cpp index f13a31e2..2b762af9 100644 --- a/src/scripts/quest/classquest/CNJ/ClsCnj004.cpp +++ b/src/scripts/quest/classquest/CNJ/ClsCnj004.cpp @@ -325,7 +325,7 @@ private: void Scene00096Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); @@ -351,7 +351,7 @@ private: void Scene00098Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy1, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); @@ -377,7 +377,7 @@ private: void Scene00100Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy2, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); diff --git a/src/scripts/quest/classquest/CNJ/ClsCnj006.cpp b/src/scripts/quest/classquest/CNJ/ClsCnj006.cpp index ab34206a..5aea70a6 100644 --- a/src/scripts/quest/classquest/CNJ/ClsCnj006.cpp +++ b/src/scripts/quest/classquest/CNJ/ClsCnj006.cpp @@ -239,7 +239,7 @@ private: void Scene00003Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy0, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); @@ -334,7 +334,7 @@ private: void Scene00011Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy1, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); @@ -429,7 +429,7 @@ private: void Scene00019Return( World::Quest& quest, Entity::Player& player, const Event::SceneResult& result ) { - auto teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto instance = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto enemy = instance->createBNpcFromInstanceId( Enemy2, 413 /*TODO: Find the right value*/, Common::BNpcType::Enemy ); enemy->hateListAdd( player.getAsPlayer(), 1 ); @@ -518,10 +518,10 @@ private: { //TODO: QuestBattle content - auto pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); eventMgr().eventFinish( player, result.eventId, 0 ); - pTeriMgr.createAndJoinQuestBattle( player, Questbattle0 ); + teriMgr.createAndJoinQuestBattle( player, Questbattle0 ); } } diff --git a/src/world/Actor/BNpc.cpp b/src/world/Actor/BNpc.cpp index a3a6567b..dcfdfba3 100644 --- a/src/world/Actor/BNpc.cpp +++ b/src/world/Actor/BNpc.cpp @@ -352,7 +352,7 @@ void Sapphire::Entity::BNpc::setState( BNpcState state ) bool Sapphire::Entity::BNpc::moveTo( const FFXIVARR_POSITION3& pos ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); auto pNaviProvider = pZone->getNaviProvider(); @@ -390,7 +390,7 @@ bool Sapphire::Entity::BNpc::moveTo( const FFXIVARR_POSITION3& pos ) bool Sapphire::Entity::BNpc::moveTo( const Entity::Chara& targetChara ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); auto pNaviProvider = pZone->getNaviProvider(); @@ -580,7 +580,7 @@ void Sapphire::Entity::BNpc::onTick() void Sapphire::Entity::BNpc::update( uint64_t tickCount ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); const uint8_t maxDistanceToOrigin = 40; @@ -908,7 +908,7 @@ void Sapphire::Entity::BNpc::setFlag( uint32_t flag ) void Sapphire::Entity::BNpc::autoAttack( CharaPtr pTarget ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); uint64_t tick = Util::getTimeMs(); diff --git a/src/world/Actor/Chara.cpp b/src/world/Actor/Chara.cpp index 4bc914fd..4c50acc1 100644 --- a/src/world/Actor/Chara.cpp +++ b/src/world/Actor/Chara.cpp @@ -510,7 +510,7 @@ void Sapphire::Entity::Chara::autoAttack( CharaPtr pTarget ) /*! \param StatusEffectPtr to be applied to the actor */ void Sapphire::Entity::Chara::addStatusEffect( StatusEffect::StatusEffectPtr pEffect ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); int8_t nextSlot = getStatusEffectFreeSlot(); diff --git a/src/world/Actor/GameObject.cpp b/src/world/Actor/GameObject.cpp index a8ab4850..f3aac262 100644 --- a/src/world/Actor/GameObject.cpp +++ b/src/world/Actor/GameObject.cpp @@ -68,7 +68,7 @@ void Sapphire::Entity::GameObject::setPos( float x, float y, float z, bool broad if( broadcastUpdate ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); pZone->updateActorPosition( *this ); } @@ -81,7 +81,7 @@ void Sapphire::Entity::GameObject::setPos( const Sapphire::Common::FFXIVARR_POSI if( broadcastUpdate ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); pZone->updateActorPosition( *this ); } diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index c996b733..012cdac1 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -817,7 +817,7 @@ uint32_t Sapphire::Entity::Player::getExp() const void Sapphire::Entity::Player::setExp( uint32_t amount ) { - auto exdData = Common::Service< Data::ExdData >::ref(); + auto& exdData = Common::Service< Data::ExdData >::ref(); uint8_t classJobIndex = exdData.getRow< Component::Excel::ClassJob >( static_cast< uint8_t >( getClass() ) )->data().WorkIndex; m_expArray[ classJobIndex ] = amount; } @@ -1438,7 +1438,7 @@ uint32_t Sapphire::Entity::Player::getPersistentEmote() const void Sapphire::Entity::Player::autoAttack( CharaPtr pTarget ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); auto mainWeap = getItemAt( Common::GearSet0, Common::GearSetSlot::MainHand ); @@ -1549,7 +1549,7 @@ uint32_t Sapphire::Entity::Player::getPrevTerritoryTypeId() const void Sapphire::Entity::Player::sendZonePackets() { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( getTerritoryId() ); auto initPacket = makeZonePacket< FFXIVIpcLogin >( getId() ); diff --git a/src/world/Manager/EventMgr.cpp b/src/world/Manager/EventMgr.cpp index d5b8c0a7..23ffff80 100644 --- a/src/world/Manager/EventMgr.cpp +++ b/src/world/Manager/EventMgr.cpp @@ -222,7 +222,6 @@ std::string Sapphire::World::Manager::EventMgr::getErrorCodeName( uint8_t errorC uint32_t Sapphire::World::Manager::EventMgr::mapEventActorToRealActor( uint32_t eventActorId ) { - auto& instanceObjectCache = Common::Service< InstanceObjectCache >::ref(); auto& exdData = Common::Service< Data::ExdData >::ref(); auto levelInfo = exdData.getRow< Component::Excel::Level >( eventActorId ); diff --git a/src/world/Manager/HousingMgr.cpp b/src/world/Manager/HousingMgr.cpp index 1ff92033..c329bd7f 100644 --- a/src/world/Manager/HousingMgr.cpp +++ b/src/world/Manager/HousingMgr.cpp @@ -300,7 +300,7 @@ Sapphire::LandPtr Sapphire::World::Manager::HousingMgr::getLandByOwnerId( uint64 if( !res->next() ) return nullptr; - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( res->getUInt( 1 ) ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); if( !hZone ) @@ -317,7 +317,7 @@ void Sapphire::World::Manager::HousingMgr::sendLandSignOwned( Entity::Player& pl auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -357,7 +357,7 @@ void Sapphire::World::Manager::HousingMgr::sendLandSignFree( Entity::Player& pla player.setActiveLand( static_cast< uint8_t >( ident.landId ), static_cast< uint8_t >( ident.wardNum ) ); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -482,7 +482,7 @@ void Sapphire::World::Manager::HousingMgr::sendWardLandInfo( Entity::Player& pla auto landSetId = toLandSetId( territoryTypeId, wardId ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -546,7 +546,7 @@ void Sapphire::World::Manager::HousingMgr::sendEstateGreeting( Entity::Player& p { auto& server = Common::Service< World::WorldServer >::ref(); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -738,7 +738,7 @@ void Sapphire::World::Manager::HousingMgr::requestEstateRename( Entity::Player& auto pSession = server.getSession( player.getCharacterId() ); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -765,7 +765,7 @@ void Sapphire::World::Manager::HousingMgr::requestEstateEditGreeting( Entity::Pl auto pSession = server.getSession( player.getCharacterId() ); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -791,7 +791,7 @@ void Sapphire::World::Manager::HousingMgr::requestEstateEditGreeting( Entity::Pl void Sapphire::World::Manager::HousingMgr::updateEstateGreeting( Entity::Player& player, const Common::LandIdent ident, const std::string& greeting ) { auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -821,7 +821,7 @@ void Sapphire::World::Manager::HousingMgr::requestEstateEditGuestAccess( Entity: auto pSession = server.getSession( player.getCharacterId() ); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -879,7 +879,7 @@ void Sapphire::World::Manager::HousingMgr::sendEstateInventory( Entity::Player& auto ident = internalZone->getLandIdent(); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -1001,7 +1001,7 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceHousingItem( Sapphire::Entity { auto& server = Common::Service< World::WorldServer >::ref(); auto pSession = server.getSession( player.getCharacterId() ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); // retail process is: @@ -1029,7 +1029,7 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceHousingItem( Sapphire::Entity auto ident = zone->getLandIdent(); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -1090,7 +1090,7 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceItemInStore( Sapphire::Entity LandPtr land; bool isOutside = false; - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); if( auto zone = std::dynamic_pointer_cast< HousingZone >( pZone ) ) @@ -1105,7 +1105,7 @@ void Sapphire::World::Manager::HousingMgr::reqPlaceItemInStore( Sapphire::Entity auto ident = zone->getLandIdent(); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -1184,7 +1184,7 @@ bool Sapphire::World::Manager::HousingMgr::placeExternalItem( Entity::Player& pl invMgr.saveHousingContainer( ident, container ); invMgr.updateHousingItemPosition( item ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); // add to zone and spawn @@ -1200,7 +1200,7 @@ bool Sapphire::World::Manager::HousingMgr::placeInteriorItem( Entity::Player& pl Inventory::HousingItemPtr item ) { auto& invMgr = Service< InventoryMgr >::ref(); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto zone = std::dynamic_pointer_cast< Territory::Housing::HousingInteriorTerritory >( pZone ); @@ -1260,7 +1260,7 @@ Sapphire::Common::Furniture Sapphire::World::Manager::HousingMgr::getYardObjectF void Sapphire::World::Manager::HousingMgr::sendInternalEstateInventoryBatch( Sapphire::Entity::Player& player, bool storeroom ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto zone = std::dynamic_pointer_cast< Territory::Housing::HousingInteriorTerritory >( pZone ); @@ -1294,7 +1294,7 @@ void Sapphire::World::Manager::HousingMgr::reqMoveHousingItem( Entity::Player& p { auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); auto land = hZone->getLand( static_cast< uint8_t >( ident.landId ) ); @@ -1411,7 +1411,7 @@ void Sapphire::World::Manager::HousingMgr::reqRemoveHousingItem( Sapphire::Entit uint16_t containerId, uint8_t slot, bool sendToStoreroom ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); if( auto terri = std::dynamic_pointer_cast< Territory::Housing::HousingInteriorTerritory >( pZone ) ) @@ -1419,7 +1419,7 @@ void Sapphire::World::Manager::HousingMgr::reqRemoveHousingItem( Sapphire::Entit auto ident = terri->getLandIdent(); auto landSetId = toLandSetId( ident.territoryTypeId, ident.wardNum ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); @@ -1625,7 +1625,7 @@ void Sapphire::World::Manager::HousingMgr::reqEstateExteriorRemodel( Sapphire::E auto& server = Common::Service< World::WorldServer >::ref(); auto pSession = server.getSession( player.getCharacterId() ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto terri = std::dynamic_pointer_cast< HousingZone >( pZone ); @@ -1655,7 +1655,7 @@ void Sapphire::World::Manager::HousingMgr::reqEstateExteriorRemodel( Sapphire::E void Sapphire::World::Manager::HousingMgr::reqEstateInteriorRemodel( Sapphire::Entity::Player& player ) { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); auto& server = Common::Service< World::WorldServer >::ref(); diff --git a/src/world/Network/Handlers/EventHandlers.cpp b/src/world/Network/Handlers/EventHandlers.cpp index 39e26d41..614a85f0 100644 --- a/src/world/Network/Handlers/EventHandlers.cpp +++ b/src/world/Network/Handlers/EventHandlers.cpp @@ -53,7 +53,7 @@ void Sapphire::Network::GameConnection::eventHandlerTalk( const Packets::FFXIVAR World::Manager::PlayerMgr::sendDebug( player, "Calling: {0}.{1}", objName, eventName ); eventMgr.eventStart( player, actorId, eventId, Event::EventHandler::Talk, 0, 0 ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( player.getTerritoryId() ); if( auto instance = pZone->getAsInstanceContent() ) { diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index eda9c4a4..42be9069 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -197,6 +197,8 @@ void Sapphire::Network::GameConnection::joinChatChannelHandler( const Packets::F void Sapphire::Network::GameConnection::moveHandler( const Packets::FFXIVARR_PACKET_RAW& inPacket, Entity::Player& player ) { + if( player.hasStateFlag( Common::BetweenAreas ) ) + return; const auto updatePositionPacket = ZoneChannelPacket< Client::FFXIVIpcUpdatePosition >( inPacket ); auto& data = updatePositionPacket.data(); diff --git a/src/world/Task/FadeBNpcTask.cpp b/src/world/Task/FadeBNpcTask.cpp index 98149317..0e2a0fa7 100644 --- a/src/world/Task/FadeBNpcTask.cpp +++ b/src/world/Task/FadeBNpcTask.cpp @@ -29,7 +29,7 @@ void FadeBNpcTask::onQueue() void FadeBNpcTask::execute() { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( m_pBNpc->getTerritoryId() ); if( !pZone ) diff --git a/src/world/Task/RemoveBNpcTask.cpp b/src/world/Task/RemoveBNpcTask.cpp index f6236793..ed32a92d 100644 --- a/src/world/Task/RemoveBNpcTask.cpp +++ b/src/world/Task/RemoveBNpcTask.cpp @@ -24,7 +24,7 @@ void RemoveBNpcTask::onQueue() void RemoveBNpcTask::execute() { - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pZone = teriMgr.getTerritoryByGuId( m_pBNpc->getTerritoryId() ); if( !pZone ) diff --git a/src/world/Territory/Housing/HousingInteriorTerritory.cpp b/src/world/Territory/Housing/HousingInteriorTerritory.cpp index 33c258b3..5f7477b3 100644 --- a/src/world/Territory/Housing/HousingInteriorTerritory.cpp +++ b/src/world/Territory/Housing/HousingInteriorTerritory.cpp @@ -63,7 +63,7 @@ void Sapphire::World::Territory::Housing::HousingInteriorTerritory::onPlayerZone auto landSetId = housingMgr.toLandSetId( m_landIdent.territoryTypeId, m_landIdent.wardNum ); - auto teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); + auto& teriMgr = Common::Service< World::Manager::TerritoryMgr >::ref(); auto pTeri = teriMgr.getTerritoryByGuId( landSetId ); auto hZone = std::dynamic_pointer_cast< HousingZone >( pTeri ); auto pLand = hZone->getLand( static_cast< uint8_t >( m_landIdent.landId ) );