1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 06:27:45 +00:00

cleanup teleport query code

This commit is contained in:
NotAdam 2019-02-08 21:20:53 +11:00
parent a90dfca45f
commit 37f71da03c
3 changed files with 7 additions and 31 deletions

View file

@ -1828,36 +1828,10 @@ void Sapphire::Entity::Player::emoteInterrupt()
sendToInRangeSet( makeActorControl142( getId(), ActorControlType::EmoteInterrupt ) );
}
void Sapphire::Entity::Player::teleportQuery( uint16_t aetheryteId, FrameworkPtr pFw )
void Sapphire::Entity::Player::teleportQuery( uint16_t aetheryteId )
{
// auto pExdData = pFw->get< Data::ExdDataGenerated >();
// // TODO: only register this action if enough gil is in possession
// auto targetAetheryte = pExdData->get< Sapphire::Data::Aetheryte >( aetheryteId );
//
// if( targetAetheryte )
// {
// auto fromAetheryte = pExdData->get< Sapphire::Data::Aetheryte >(
// pExdData->get< Sapphire::Data::TerritoryType >( getZoneId() )->aetheryte );
//
// // calculate cost - does not apply for favorite points or homepoints neither checks for aether tickets
// auto cost = static_cast< uint16_t > (
// ( std::sqrt( std::pow( fromAetheryte->aetherstreamX - targetAetheryte->aetherstreamX, 2 ) +
// std::pow( fromAetheryte->aetherstreamY - targetAetheryte->aetherstreamY, 2 ) ) / 2 ) + 100 );
//
// // cap at 999 gil
// cost = cost > uint16_t{ 999 } ? uint16_t{ 999 } : cost;
//
// bool insufficientGil = getCurrency( Common::CurrencyType::Gil ) < cost;
// // TODO: figure out what param1 really does
// queuePacket( makeActorControl143( getId(), TeleportStart, insufficientGil ? 2 : 0, aetheryteId ) );
//
// if( !insufficientGil )
// {
// Action::ActionPtr pActionTeleport;
// pActionTeleport = Action::make_ActionTeleport( getAsPlayer(), aetheryteId, cost, pFw );
// setCurrentAction( pActionTeleport );
// }
// }
m_teleportTargetAetheryte = aetheryteId;
sendDebug( "requested aetheryte destination: {0}", aetheryteId );
}
uint8_t Sapphire::Entity::Player::getNextObjSpawnIndexForActorId( uint32_t actorId )

View file

@ -531,7 +531,7 @@ namespace Sapphire::Entity
void teleport( uint16_t aetheryteId, uint8_t type = 1 );
/*! query teleport of a specified type */
void teleportQuery( uint16_t aetheryteId, FrameworkPtr pFw );
void teleportQuery( uint16_t aetheryteId );
/*! prepares zoning / fades out the screen */
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadeOutTime = 0, uint16_t animation = 0 );
@ -1086,6 +1086,8 @@ namespace Sapphire::Entity
uint32_t m_mount;
uint32_t m_emoteMode;
uint16_t m_teleportTargetAetheryte;
Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;
};

View file

@ -274,7 +274,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
case ClientTriggerType::Teleport: // Teleport
{
player.teleportQuery( param11, pFw );
player.teleportQuery( param11 );
break;
}
case ClientTriggerType::DyeItem: // Dye item