dufernst / LegionCore-7.3.5

World of Warcraft - Legion (7.3.5 26972) source, based on leaked source from uwow.biz.
GNU General Public License v2.0
221 stars 227 forks source link

Hunter Pet #182

Open Elgrimm opened 2 months ago

Elgrimm commented 2 months ago

Legion Pet Hunter When changing location it disappears as if it goes into another phase... @dufernst need you help.

Elgrimm commented 1 month ago

@dufernst no idea?

Elgrimm commented 1 month ago

my fix need add in Player.cpp

bool Player::SafeTeleport(uint32 mapid, float x, float y, float z, float orientation, uint32 options, uint32 spellID/=false/) { ........... // this will be used instead of the current location in SaveToDB m_teleport_dest = WorldLocation(mapid, x, y, z, orientation); SetFallInformation(0, z);

    // code for finish transfer called in WorldSession::HandleMovementOpcodes()
    // at client packet CMSG_MOVE_TELEPORT_ACK
    SetSemaphoreTeleportNear(true);
    // near teleport, triggering send CMSG_MOVE_TELEPORT_ACK from client at landing
    if (!GetSession()->PlayerLogout())
    {
        Position newPos;
        newPos.Relocate(x, y, z, orientation);
        SendTeleportPacket(newPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place
    }

        +AddDelayedEvent(1000, [this]() -> void
        +{
           + ResummonPetTemporaryUnSummonedIfAny();
      +  });
ReyDonovan commented 1 month ago

There is a solution, full implementation, tomorrow if I have time I will do it

Elgrimm commented 1 month ago

There is a solution, full implementation, tomorrow if I have time I will do it

Thanks

Elgrimm commented 1 month ago

There is a solution, full implementation, tomorrow if I have time I will do it @ReyDonovan Maybe need edit ? // Phase pets and summons if (IsInWorld()) {

    for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
        if (Unit* unit = ObjectAccessor::GetUnit(*this, *itr))
            //if (unit->IsCreature())
                unit->SetPhaseMask(newPhaseMask, true);

    for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i)
        if (m_SummonSlot[i])
            if (Creature* summon = GetMap()->GetCreature(m_SummonSlot[i]))
                summon->SetPhaseMask(newPhaseMask, true);
}

RemoveNotOwnSingleTargetAuras(newPhaseMask);            // we can lost access to caster or target

// Update visibility after phasing pets and summons so they wont despawn
if (update)
    UpdateObjectVisibility();

}

Elgrimm commented 1 month ago

No.... I have no ideas