diff --git a/src/scripts/common/aethernet/Aetheryte.cpp b/src/scripts/common/aethernet/Aetheryte.cpp index a125affe..64acd0c5 100644 --- a/src/scripts/common/aethernet/Aetheryte.cpp +++ b/src/scripts/common/aethernet/Aetheryte.cpp @@ -108,8 +108,7 @@ public: void onTalk( uint32_t eventId, Entity::Player& player, uint64_t actorId ) override { - //auto& exdData = Common::Service< Sapphire::Data::ExdDataGenerated >::ref(); - auto& exdData = *reinterpret_cast< Sapphire::Data::ExdDataGenerated* >( player.getExdData() ); + auto& exdData = Common::Service< Sapphire::Data::ExdDataGenerated >::ref(); auto aetherInfo = exdData.get< Sapphire::Data::Aetheryte >( eventId & 0xFFFF ); if( !aetherInfo ) diff --git a/src/scripts/common/aethernet/HousingAethernet.cpp b/src/scripts/common/aethernet/HousingAethernet.cpp index be107271..1af780ad 100644 --- a/src/scripts/common/aethernet/HousingAethernet.cpp +++ b/src/scripts/common/aethernet/HousingAethernet.cpp @@ -21,8 +21,7 @@ public: { player.playScene( eventId, 0, HIDE_HOTBAR | NO_DEFAULT_CAMERA, [this, eventId]( Entity::Player& player, const Event::SceneResult& result ) { - //auto& exdData = Common::Service< Sapphire::Data::ExdDataGenerated >::ref(); - auto& exdData = *reinterpret_cast< Sapphire::Data::ExdDataGenerated* >( player.getExdData() ); + auto& exdData = Common::Service< Sapphire::Data::ExdDataGenerated >::ref(); auto housingZone = std::dynamic_pointer_cast< HousingZone >( player.getCurrentTerritory() ); if( !housingZone ) @@ -41,8 +40,7 @@ public: // moving a player inside an event will crash the game so we end it here player.eventFinish( eventId, 1 ); - //auto& playerMgr = Common::Service< Sapphire::World::Manager::PlayerMgr >::ref(); - auto& playerMgr = *reinterpret_cast< Sapphire::World::Manager::PlayerMgr* >( player.getPlayerMgr() ); + auto& playerMgr = Common::Service< Sapphire::World::Manager::PlayerMgr >::ref(); playerMgr.movePlayerToLandDestination( player, pHousingAethernet->level, housingZone->getWardNum() ); } ); } diff --git a/src/scripts/common/eobj/HousingEstateEntrance.cpp b/src/scripts/common/eobj/HousingEstateEntrance.cpp index d40025cd..2abc371b 100644 --- a/src/scripts/common/eobj/HousingEstateEntrance.cpp +++ b/src/scripts/common/eobj/HousingEstateEntrance.cpp @@ -26,8 +26,7 @@ public: if( result.param2 != 1 ) return; - //auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); - auto& terriMgr = *reinterpret_cast< Sapphire::World::Manager::TerritoryMgr* >( player.getTerritoryMgr() ); + auto& terriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); auto zone = std::dynamic_pointer_cast< HousingZone >( player.getCurrentTerritory() ); if( !zone ) diff --git a/src/scripts/quest/ManFst005.cpp b/src/scripts/quest/ManFst005.cpp index 7b47a3ef..f9177bf8 100644 --- a/src/scripts/quest/ManFst005.cpp +++ b/src/scripts/quest/ManFst005.cpp @@ -142,8 +142,7 @@ class ManFst005 : public Sapphire::ScriptAPI::EventScript { if( result.param2 == 1 ) { - //auto& pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); - auto& pTeriMgr = *reinterpret_cast< Sapphire::World::Manager::TerritoryMgr* >( player.getTerritoryMgr() ); + auto& pTeriMgr = Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); player.eventFinish( result.eventId, 0 ); pTeriMgr.createAndJoinQuestBattle( player, Questbattle0 ); diff --git a/src/world/Actor/Player.cpp b/src/world/Actor/Player.cpp index 3bad0375..32271da5 100644 --- a/src/world/Actor/Player.cpp +++ b/src/world/Actor/Player.cpp @@ -2762,31 +2762,6 @@ bool Sapphire::Entity::Player::gaugeSamHasAnySen() return static_cast< uint8_t >( m_gauge.sam.sen ) > 0; } -void* Sapphire::Entity::Player::getEventMgr() -{ - return &Common::Service< Sapphire::World::Manager::EventMgr >::ref(); -} - -void* Sapphire::Entity::Player::getExdData() -{ - return &Common::Service< Data::ExdDataGenerated >::ref(); -} - -void* Sapphire::Entity::Player::getPlayerMgr() -{ - return &Common::Service< Sapphire::World::Manager::PlayerMgr >::ref(); -} - -void* Sapphire::Entity::Player::getInstanceObjectCache() -{ - return &Common::Service< Sapphire::InstanceObjectCache >::ref(); -} - -void* Sapphire::Entity::Player::getTerritoryMgr() -{ - return &Common::Service< Sapphire::World::Manager::TerritoryMgr >::ref(); -} - void Sapphire::Entity::Player::setPosAndSendActorMove( float x, float y, float z, float rot ) { setRot( rot ); diff --git a/src/world/Actor/Player.h b/src/world/Actor/Player.h index bd0d458c..726750f4 100644 --- a/src/world/Actor/Player.h +++ b/src/world/Actor/Player.h @@ -1052,12 +1052,6 @@ namespace Sapphire::Entity TerritoryPtr getOrCreatePrivateInstance( uint32_t zoneId ); bool enterPredefinedPrivateInstance( uint32_t zoneId ); - void* getEventMgr(); - void* getExdData(); - void* getPlayerMgr(); - void* getInstanceObjectCache(); - void* getTerritoryMgr(); - Common::HuntingLogEntry& getHuntingLogEntry( uint8_t index ); void sendHuntingLog(); diff --git a/src/world/Manager/PlayerMgr.cpp b/src/world/Manager/PlayerMgr.cpp index d6e1ff5f..79062f2e 100644 --- a/src/world/Manager/PlayerMgr.cpp +++ b/src/world/Manager/PlayerMgr.cpp @@ -16,8 +16,7 @@ using namespace Sapphire::World::Manager; void Sapphire::World::Manager::PlayerMgr::movePlayerToLandDestination( Sapphire::Entity::Player& player, uint32_t landId, uint16_t param ) { // check if we have one in the db first - //auto& terriMgr = Common::Service< TerritoryMgr >::ref(); - auto& terriMgr = *reinterpret_cast< Sapphire::World::Manager::TerritoryMgr* >( player.getTerritoryMgr() ); + auto& terriMgr = Common::Service< TerritoryMgr >::ref(); Sapphire::TerritoryPtr destinationZone;