Core/Pets: Some minor corrections to 3ea75c50d0

This commit is contained in:
kaelima
2012-05-24 16:29:43 +02:00
parent 7a24a16e0b
commit 84b420160d
2 changed files with 11 additions and 15 deletions
+9 -13
View File
@@ -169,15 +169,11 @@ void PetAI::UpdateAI(const uint32 diff)
// Some spells can target enemy or friendly (DK Ghoul's Leap) // Some spells can target enemy or friendly (DK Ghoul's Leap)
// Check for enemy first (pet then owner) // Check for enemy first (pet then owner)
if (Unit* target = me->getAttackerForHelper()) Unit* target = me->getAttackerForHelper();
{ if (!target && owner)
if (CanAttack(target) && spell->CanAutoCast(target)) target = owner->getAttackerForHelper();
{
targetSpellStore.push_back(std::make_pair(target, spell)); if (target)
spellUsed = true;
}
}
else if (Unit* target = me->GetCharmerOrOwner()->getAttackerForHelper())
{ {
if (CanAttack(target) && spell->CanAutoCast(target)) if (CanAttack(target) && spell->CanAutoCast(target))
{ {
@@ -191,15 +187,15 @@ void PetAI::UpdateAI(const uint32 diff)
{ {
for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar)
{ {
Unit* target = ObjectAccessor::GetUnit(*me, *tar); Unit* ally = ObjectAccessor::GetUnit(*me, *tar);
//only buff targets that are in combat, unless the spell can only be cast while out of combat //only buff targets that are in combat, unless the spell can only be cast while out of combat
if (!target) if (!ally)
continue; continue;
if (spell->CanAutoCast(target)) if (spell->CanAutoCast(ally))
{ {
targetSpellStore.push_back(std::make_pair(target, spell)); targetSpellStore.push_back(std::make_pair(ally, spell));
spellUsed = true; spellUsed = true;
break; break;
} }
+2 -2
View File
@@ -245,7 +245,7 @@ enum AreaFlags
AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?) AREA_FLAG_CITY = 0x00000200, // only for one zone named "City" (where it located?)
AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag) AREA_FLAG_OUTLAND = 0x00000400, // expansion zones? (only Eye of the Storm not have this flag, but have 0x00004000 flag)
AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled) AREA_FLAG_SANCTUARY = 0x00000800, // sanctuary area (PvP disabled)
AREA_FLAG_NEED_FLY = 0x00001000, // Unknown AREA_FLAG_NEED_FLY = 0x00001000, // Respawn alive at the graveyard without corpse
AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a AREA_FLAG_UNUSED1 = 0x00002000, // Unused in 3.3.5a
AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag) AREA_FLAG_OUTLAND2 = 0x00004000, // expansion zones? (only Circle of Blood Arena not have this flag, but have 0x00000400 flag)
AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area) AREA_FLAG_OUTDOOR_PVP = 0x00008000, // pvp objective area? (Death's Door also has this flag although it's no pvp object area)
@@ -260,7 +260,7 @@ enum AreaFlags
AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones AREA_FLAG_WINTERGRASP = 0x01000000, // Wintergrasp and it's subzones
AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_INSIDE = 0x02000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors AREA_FLAG_OUTSIDE = 0x04000000, // used for determinating spell related inside/outside questions in Map::IsOutdoors
AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Same as AREA_FLAG_WINTERGRASP except for The Sunken Ring and Western Bridge. AREA_FLAG_WINTERGRASP_2 = 0x08000000, // Can Hearth And Resurrect From Area
AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly AREA_FLAG_NO_FLY_ZONE = 0x20000000 // Marks zones where you cannot fly
}; };