Compile fix.

This commit is contained in:
tomrus88 2010-01-09 21:47:16 +03:00
parent aa668bc66f
commit a8b04f09e0
3 changed files with 22 additions and 19 deletions

View file

@ -210,7 +210,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
case HUNTER_PET:
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
SetSheath(SHEATH_STATE_MELEE);
SetByteValue(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_RENAME_NOT_ALLOWED : UNIT_RENAME_ALLOWED);
SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
// this enables popup window (pet abandon, cancel)
@ -409,7 +409,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
<< uint32(m_charmInfo->GetReactState()) << ", "
<< uint32(mode) << ", '"
<< name.c_str() << "', "
<< uint32((GetByteValue(UNIT_FIELD_BYTES_2, 2) == UNIT_RENAME_ALLOWED)?0:1) << ", "
<< uint32(HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ? 0 : 1) << ", "
<< (curhealth < 1 ? 1 : curhealth) << ", "
<< curmana << ", "
<< GetPower(POWER_HAPPINESS) << ", '";
@ -784,7 +784,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
{
SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100);
SetSheath(SHEATH_STATE_MELEE);
SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
SetUInt32Value(UNIT_MOD_CAST_SPEED, creature->GetUInt32Value(UNIT_MOD_CAST_SPEED));
}
return true;

View file

@ -439,7 +439,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
Pet* pet = _player->GetMap()->GetPet(petguid);
// check it!
if( !pet || pet->getPetType() != HUNTER_PET ||
pet->GetByteValue(UNIT_FIELD_BYTES_2, 2) != UNIT_RENAME_ALLOWED ||
!pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo() )
return;
@ -461,7 +461,7 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
if(_player->GetGroup())
_player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_NAME);
pet->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED);
pet->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
if(isdeclined)
{

View file

@ -4446,7 +4446,10 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->SetName(new_name);
}
else if(NewSummon->getPetType() == HUNTER_PET)
NewSummon->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED);
{
NewSummon->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
NewSummon->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_ABANDONED);
}
NewSummon->AIM_Initialize();
NewSummon->SetHealth(NewSummon->GetMaxHealth());
@ -6953,7 +6956,7 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/)
!((Creature*)unitTarget)->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET)
return;
unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED);
unitTarget->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
}
void Spell::EffectPlayMusic(uint32 i)