mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[8710] Make vehicle guid counter per-map local.
Also update/drop/move to Map some dependent functions.
This commit is contained in:
parent
53b6d28a24
commit
b942616ded
15 changed files with 46 additions and 69 deletions
|
|
@ -276,7 +276,7 @@ void WorldSession::HandlePetNameQuery( WorldPacket & recv_data )
|
|||
|
||||
void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber)
|
||||
{
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid);
|
||||
Creature* pet = _player->GetMap()->GetCreatureOrPetOrVehicle(petguid);
|
||||
if(!pet || !pet->GetCharmInfo() || pet->GetCharmInfo()->GetPetNumber() != petnumber)
|
||||
return;
|
||||
|
||||
|
|
@ -308,12 +308,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data )
|
|||
|
||||
recv_data >> petguid;
|
||||
|
||||
// FIXME: charmed case
|
||||
//Pet* pet = ObjectAccessor::Instance().GetPet(petguid);
|
||||
if(ObjectAccessor::FindPlayer(petguid))
|
||||
return;
|
||||
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, petguid);
|
||||
Creature* pet = _player->GetMap()->GetCreatureOrPetOrVehicle(petguid);
|
||||
|
||||
if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm()))
|
||||
{
|
||||
|
|
@ -456,8 +451,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data )
|
|||
return;
|
||||
|
||||
// pet/charmed
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||
if(pet)
|
||||
if (Creature* pet = _player->GetMap()->GetCreatureOrPetOrVehicle(guid))
|
||||
{
|
||||
if(pet->isPet())
|
||||
{
|
||||
|
|
@ -514,10 +508,7 @@ void WorldSession::HandlePetSpellAutocastOpcode( WorldPacket& recvPacket )
|
|||
if(!_player->GetPet() && !_player->GetCharm())
|
||||
return;
|
||||
|
||||
if(ObjectAccessor::FindPlayer(guid))
|
||||
return;
|
||||
|
||||
Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid);
|
||||
Creature* pet = _player->GetMap()->GetCreatureOrPetOrVehicle(guid);
|
||||
|
||||
if(!pet || (pet != _player->GetPet() && pet != _player->GetCharm()))
|
||||
{
|
||||
|
|
@ -561,10 +552,7 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket )
|
|||
if (!_player->GetPet() && !_player->GetCharm())
|
||||
return;
|
||||
|
||||
if (GUID_HIPART(guid) == HIGHGUID_PLAYER)
|
||||
return;
|
||||
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid);
|
||||
Creature* pet = _player->GetMap()->GetCreatureOrPetOrVehicle(guid);
|
||||
|
||||
if (!pet || (pet != _player->GetPet() && pet!= _player->GetCharm()))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue