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:
parent
a90dfca45f
commit
37f71da03c
3 changed files with 7 additions and 31 deletions
|
@ -1828,36 +1828,10 @@ void Sapphire::Entity::Player::emoteInterrupt()
|
||||||
sendToInRangeSet( makeActorControl142( getId(), ActorControlType::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 >();
|
m_teleportTargetAetheryte = aetheryteId;
|
||||||
// // TODO: only register this action if enough gil is in possession
|
sendDebug( "requested aetheryte destination: {0}", aetheryteId );
|
||||||
// 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 );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Sapphire::Entity::Player::getNextObjSpawnIndexForActorId( uint32_t actorId )
|
uint8_t Sapphire::Entity::Player::getNextObjSpawnIndexForActorId( uint32_t actorId )
|
||||||
|
|
|
@ -531,7 +531,7 @@ namespace Sapphire::Entity
|
||||||
void teleport( uint16_t aetheryteId, uint8_t type = 1 );
|
void teleport( uint16_t aetheryteId, uint8_t type = 1 );
|
||||||
|
|
||||||
/*! query teleport of a specified type */
|
/*! query teleport of a specified type */
|
||||||
void teleportQuery( uint16_t aetheryteId, FrameworkPtr pFw );
|
void teleportQuery( uint16_t aetheryteId );
|
||||||
|
|
||||||
/*! prepares zoning / fades out the screen */
|
/*! prepares zoning / fades out the screen */
|
||||||
void prepareZoning( uint16_t targetZone, bool fadeOut, uint8_t fadeOutTime = 0, uint16_t animation = 0 );
|
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_mount;
|
||||||
uint32_t m_emoteMode;
|
uint32_t m_emoteMode;
|
||||||
|
|
||||||
|
uint16_t m_teleportTargetAetheryte;
|
||||||
|
|
||||||
Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
|
Util::SpawnIndexAllocator< uint8_t > m_objSpawnIndexAllocator;
|
||||||
Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;
|
Util::SpawnIndexAllocator< uint8_t > m_actorSpawnIndexAllocator;
|
||||||
};
|
};
|
||||||
|
|
|
@ -274,7 +274,7 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( FrameworkPtr pFw,
|
||||||
case ClientTriggerType::Teleport: // Teleport
|
case ClientTriggerType::Teleport: // Teleport
|
||||||
{
|
{
|
||||||
|
|
||||||
player.teleportQuery( param11, pFw );
|
player.teleportQuery( param11 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ClientTriggerType::DyeItem: // Dye item
|
case ClientTriggerType::DyeItem: // Dye item
|
||||||
|
|
Loading…
Add table
Reference in a new issue