*Fix the client crash caused by enslave demon.
--HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -204,12 +204,12 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
||||
case SUMMON_PET:
|
||||
petlevel=owner->getLevel();
|
||||
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x800); //class=mage
|
||||
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||
// this enables popup window (pet dismiss, cancel)
|
||||
break;
|
||||
case HUNTER_PET:
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
|
||||
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior,gender=none,power=focus
|
||||
SetSheath(SHEATH_STATE_MELEE);
|
||||
SetByteValue(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_RENAME_NOT_ALLOWED : UNIT_RENAME_ALLOWED);
|
||||
|
||||
|
||||
+2
-1
@@ -13669,7 +13669,7 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
||||
if(cinfo && cinfo->type == CREATURE_TYPE_DEMON)
|
||||
{
|
||||
//to prevent client crash
|
||||
//SetFlag(UNIT_FIELD_BYTES_0, 2048);
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, 1, (uint8)CLASS_MAGE);
|
||||
|
||||
//just to enable stat window
|
||||
if(GetCharmInfo())
|
||||
@@ -13764,6 +13764,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
||||
CreatureInfo const *cinfo = ((Creature*)this)->GetCreatureInfo();
|
||||
if(cinfo && cinfo->type == CREATURE_TYPE_DEMON)
|
||||
{
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
|
||||
if(GetCharmInfo())
|
||||
GetCharmInfo()->SetPetNumber(0, true);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user