mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-04 01:37:47 +00:00
Merge pull request #666 from collett8192/update_5.25
Handle minion despawn.
This commit is contained in:
commit
47c031b4b6
3 changed files with 13 additions and 4 deletions
|
@ -350,6 +350,7 @@ namespace Sapphire::Network::ActorControl
|
||||||
|
|
||||||
DismountReq = 0x65,
|
DismountReq = 0x65,
|
||||||
SpawnCompanionReq = 0x66,
|
SpawnCompanionReq = 0x66,
|
||||||
|
DespawnCompanionReq = 0x67,
|
||||||
RemoveStatusEffect = 0x68,
|
RemoveStatusEffect = 0x68,
|
||||||
CastCancel = 0x69,
|
CastCancel = 0x69,
|
||||||
|
|
||||||
|
|
|
@ -1563,11 +1563,14 @@ void Sapphire::Entity::Player::dismount()
|
||||||
|
|
||||||
void Sapphire::Entity::Player::spawnCompanion( uint16_t id )
|
void Sapphire::Entity::Player::spawnCompanion( uint16_t id )
|
||||||
{
|
{
|
||||||
|
if( id > 0 )
|
||||||
|
{
|
||||||
auto& exdData = Common::Service< Data::ExdDataGenerated >::ref();
|
auto& exdData = Common::Service< Data::ExdDataGenerated >::ref();
|
||||||
|
|
||||||
auto companion = exdData.get< Data::Companion >( id );
|
auto companion = exdData.get< Data::Companion >( id );
|
||||||
if( !id )
|
if( !companion )
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_companionId = id;
|
m_companionId = id;
|
||||||
sendToInRangeSet( makeActorControl( getId(), ActorControlType::ToggleCompanion, id ), true );
|
sendToInRangeSet( makeActorControl( getId(), ActorControlType::ToggleCompanion, id ), true );
|
||||||
|
|
|
@ -130,6 +130,11 @@ void Sapphire::Network::GameConnection::clientTriggerHandler( const Packets::FFX
|
||||||
player.spawnCompanion( static_cast< uint16_t >( param1 ) );
|
player.spawnCompanion( static_cast< uint16_t >( param1 ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ClientTriggerType::DespawnCompanionReq:
|
||||||
|
{
|
||||||
|
player.spawnCompanion( 0 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ClientTriggerType::RemoveStatusEffect: // Remove status (clicking it off)
|
case ClientTriggerType::RemoveStatusEffect: // Remove status (clicking it off)
|
||||||
{
|
{
|
||||||
// todo: check if status can be removed by client from exd
|
// todo: check if status can be removed by client from exd
|
||||||
|
|
Loading…
Add table
Reference in a new issue