mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-28 07:07:45 +00:00
More GM Call/Jump fixes
This commit is contained in:
parent
12c053cdda
commit
73f261927b
1 changed files with 11 additions and 12 deletions
|
@ -627,17 +627,16 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
|
||||||
{
|
{
|
||||||
player.exitInstance();
|
player.exitInstance();
|
||||||
}
|
}
|
||||||
if( targetPlayer->getCurrentInstance() && player.getCurrentInstance() != targetPlayer->getCurrentInstance() )
|
if( targetPlayer->getCurrentZone()->getGuId() != player.getCurrentZone()->getGuId() )
|
||||||
{
|
{
|
||||||
auto instance = targetPlayer->getCurrentInstance();
|
// Checks if the target player is in an InstanceContent to avoid binding to a Zone or PublicContent
|
||||||
auto pInstanceContent = instance->getAsInstanceContent();
|
if( targetPlayer->getCurrentInstance() )
|
||||||
// Not sure if GMs actually get bound to an instance they jump to on retail. It's mostly here to avoid a crash for now.
|
{
|
||||||
pInstanceContent->bindPlayer( player.getId() );
|
auto pInstanceContent = targetPlayer->getCurrentInstance()->getAsInstanceContent();
|
||||||
player.setInstance( targetPlayer->getCurrentInstance() );
|
// Not sure if GMs actually get bound to an instance they jump to on retail. It's mostly here to avoid a crash for now
|
||||||
}
|
pInstanceContent->bindPlayer( player.getId() );
|
||||||
if( targetPlayer->getZoneId() != player.getZoneId() )
|
}
|
||||||
{
|
player.setInstance( targetPlayer->getCurrentZone()->getGuId() );
|
||||||
player.setZone( targetPlayer->getZoneId() );
|
|
||||||
}
|
}
|
||||||
player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
|
player.changePosition( targetActor->getPos().x, targetActor->getPos().y, targetActor->getPos().z,
|
||||||
targetActor->getRot() );
|
targetActor->getRot() );
|
||||||
|
@ -658,9 +657,9 @@ void Sapphire::Network::GameConnection::gm2Handler( FrameworkPtr pFw,
|
||||||
{
|
{
|
||||||
targetPlayer->exitInstance();
|
targetPlayer->exitInstance();
|
||||||
}
|
}
|
||||||
if ( targetPlayer->getZoneId() != player.getZoneId() )
|
if( targetPlayer->getCurrentZone()->getGuId() != player.getCurrentZone()->getGuId() )
|
||||||
{
|
{
|
||||||
targetPlayer->setZone( player.getZoneId() );
|
targetPlayer->setInstance( player.getCurrentZone()->getGuId() );
|
||||||
}
|
}
|
||||||
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() );
|
targetPlayer->changePosition( player.getPos().x, player.getPos().y, player.getPos().z, player.getRot() );
|
||||||
targetPlayer->sendZoneInPackets( 0x00, 0x00, 0, 0, false );
|
targetPlayer->sendZoneInPackets( 0x00, 0x00, 0, 0, false );
|
||||||
|
|
Loading…
Add table
Reference in a new issue