Core/Pets: Some minor corrections to 3ea75c50d0
This commit is contained in:
@@ -169,15 +169,11 @@ void PetAI::UpdateAI(const uint32 diff)
|
||||
|
||||
// Some spells can target enemy or friendly (DK Ghoul's Leap)
|
||||
// Check for enemy first (pet then owner)
|
||||
if (Unit* target = me->getAttackerForHelper())
|
||||
{
|
||||
if (CanAttack(target) && spell->CanAutoCast(target))
|
||||
{
|
||||
targetSpellStore.push_back(std::make_pair(target, spell));
|
||||
spellUsed = true;
|
||||
}
|
||||
}
|
||||
else if (Unit* target = me->GetCharmerOrOwner()->getAttackerForHelper())
|
||||
Unit* target = me->getAttackerForHelper();
|
||||
if (!target && owner)
|
||||
target = owner->getAttackerForHelper();
|
||||
|
||||
if (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)
|
||||
{
|
||||
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
|
||||
if (!target)
|
||||
if (!ally)
|
||||
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;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ enum AreaFlags
|
||||
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_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_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)
|
||||
@@ -260,7 +260,7 @@ enum AreaFlags
|
||||
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_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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user