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

@ -136,7 +136,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
}
PetType pet_type = PetType(fields[18].GetUInt8());
if(pet_type==HUNTER_PET)
if(pet_type == HUNTER_PET)
{
CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(petentry);
if(!creatureInfo || !creatureInfo->isTameable(owner->CanTameExoticPets()))
@ -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,8 +409,8 @@ 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) << ", "
<< (curhealth<1?1:curhealth) << ", "
<< 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

@ -4328,13 +4328,13 @@ void Spell::EffectSummonPet(uint32 i)
Pet* NewSummon = new Pet;
// petentry==0 for hunter "call pet" (current pet summoned if any)
if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster,petentry))
if(m_caster->GetTypeId() == TYPEID_PLAYER && NewSummon->LoadPetFromDB((Player*)m_caster, petentry))
{
if(NewSummon->getPetType()==SUMMON_PET)
if(NewSummon->getPetType() == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraList const& auraClassScripts = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if((*itr)->GetModifier()->m_miscvalue == 2228)
{
@ -4360,7 +4360,7 @@ void Spell::EffectSummonPet(uint32 i)
if(!cInfo)
{
sLog.outError("EffectSummonPet: creature entry %u not found.",petentry);
sLog.outError("EffectSummonPet: creature entry %u not found.", petentry);
delete NewSummon;
return;
}
@ -4415,7 +4415,7 @@ void Spell::EffectSummonPet(uint32 i)
// this enables popup window (pet dismiss, cancel), hunter pet additional flags set later
if(m_caster->GetTypeId() == TYPEID_PLAYER)
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS,UNIT_FLAG_PVP_ATTACKABLE);
NewSummon->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
if(m_caster->IsPvP())
NewSummon->SetPvP(true);
@ -4425,13 +4425,13 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->InitLevelupSpellsForLevel();
NewSummon->InitTalentForLevel();
if(NewSummon->getPetType()==SUMMON_PET)
if(NewSummon->getPetType() == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (new pet)
Unit::AuraList const& auraClassScripts = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin(); itr != auraClassScripts.end();)
{
if((*itr)->GetModifier()->m_miscvalue==2228)
if((*itr)->GetModifier()->m_miscvalue == 2228)
{
m_caster->RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
@ -4441,12 +4441,15 @@ void Spell::EffectSummonPet(uint32 i)
}
// generate new name for summon pet
std::string new_name=sObjectMgr.GeneratePetName(petentry);
std::string new_name = sObjectMgr.GeneratePetName(petentry);
if(!new_name.empty())
NewSummon->SetName(new_name);
}
else if(NewSummon->getPetType()==HUNTER_PET)
NewSummon->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_NOT_ALLOWED);
else if(NewSummon->getPetType() == HUNTER_PET)
{
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)