[FIX] Drops von Pets
Vorhin meinte n Kumpel so, dass es den Bug gibt, dass wenn Pets Mobs killen der Name vom Pet über den gedropten Items steht und man diese nicht aufheben kann.Naja habs kurz gebastelt.Da es nur ne kleinigkeit is schenk ichs euch mal.
Autor: xCPx EPVP
service.h:
add:
#define __FIX_PET_ATTACK
char.h:
search:
#ifdef __PET_SYSTEM__
private:
bool m_bIsPet;
public:
void SetPet() { m_bIsPet = true; }
bool IsPet() { return m_bIsPet; }
#endif
add below:
#ifdef __FIX_PET_ATTACK
private:
LPCHARACTER m_Owner = NULL;
public:
void SetOwner(LPCHARACTER owner) { m_Owner = owner; }
LPCHARACTER GetOwner() { return m_Owner; }
#endif
char.cpp:
search:
#ifdef PET_SYSTEM
m_petSystem = 0;
m_bIsPet = false;
#endif
add below:
#ifdef __FIX_PET_ATTACK
m_Owner = NULL;
#endif
PetSystem.cpp:
in:
DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
search:
if (0 != m_pkChar)
{
m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
m_dwVID = m_pkChar->GetVID();
return m_dwVID;
}
replace it with:
if (0 != m_pkChar)
{
#ifdef __FIX_PET_ATTACK
m_pkChar->SetOwner(m_pkOwner);
m_pkChar->SetPet();
#endif
m_pkChar->Show (m_pkOwner->GetMapIndex(), x, y);
m_dwVID = m_pkChar->GetVID();
return m_dwVID;
}
search:
m_pkChar->SetEmpire(m_pkOwner->GetEmpire());
add below:
#ifdef __FIX_PET_ATTACK
m_pkChar->SetOwner(m_pkOwner);
#endif
item.cpp:
in:
void CItem::SetOwnership(LPCHARACTER ch, int iSec)
add at the beginning of the function:
#ifdef __FIX_PET_ATTACK
if(ch)
{
if (ch->IsPet())
{
LPCHARACTER owner = ch->GetOwner();
if(owner)
ch = owner;
}
}
#endif