*Add some debug info to procflag

*Fix Sudden Death.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-13 20:50:52 +02:00
parent b972327979
commit f46d1b3b81
4 changed files with 20 additions and 9 deletions
+4 -5
View File
@@ -16454,19 +16454,18 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent)
}
}
pet->SavePetToDB(mode);
// only if current pet in slot
switch(pet->getPetType())
{
case POSSESSED_PET:
pet->RemoveCharmedOrPossessedBy(NULL);
break;
default:
pet->SavePetToDB(mode);
SetGuardian(pet, false);
break;
}
SetGuardian(pet, false);
pet->CleanupsBeforeDelete();
pet->AddObjectToRemoveList();
pet->m_removed = true;
@@ -17988,7 +17987,7 @@ bool Player::canSeeOrDetect(Unit const* u, bool detect, bool inVisibleList, bool
return false;
}
if(u->GetVisibility() == VISIBILITY_OFF || u->m_invisibilityMask )
if(u->GetVisibility() == VISIBILITY_OFF)
{
// GMs see any players, not higher GMs and all units
if(isGameMaster())
+1 -2
View File
@@ -3701,7 +3701,6 @@ SpellCastResult Spell::CheckCast(bool strict)
if(Unit *target = m_targets.getUnitTarget())
{
// target state requirements (not allowed state), apply to self also
if(!m_IsTriggeredSpell && m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot), m_spellInfo, m_caster))
return SPELL_FAILED_TARGET_AURASTATE;
@@ -3715,7 +3714,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if(target != m_caster)
{
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
if(m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster))
if(!m_IsTriggeredSpell && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster))
return SPELL_FAILED_TARGET_AURASTATE;
// Not allow casting on flying player
+1 -2
View File
@@ -942,8 +942,7 @@ void Aura::_AddAura()
// set infinity cooldown state for spells
if(caster && caster->GetTypeId() == TYPEID_PLAYER)
{
// Do not apply cooldown for caster passive spells (needed by Reincarnation)
if (!(caster->HasSpell(GetId()) && IsPassive()) && m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
{
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
+14
View File
@@ -11564,6 +11564,8 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (GetTypeId() == TYPEID_PLAYER && i->spellProcEvent && i->spellProcEvent->cooldown)
cooldown = i->spellProcEvent->cooldown;
uint32 procDebug = 0;
for (uint8 effIndex = 0; effIndex<MAX_SPELL_EFFECTS;++effIndex)
{
if (!(i->effMask & (1<<effIndex)))
@@ -11598,18 +11600,27 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 1)
sLog.outError("Dummy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 1;
break;
}
case SPELL_AURA_OBS_MOD_ENERGY:
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 2)
sLog.outError("ObsModEnergy aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 2;
break;
case SPELL_AURA_MOD_HASTE:
{
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown))
continue;
if (procDebug & 4)
sLog.outError("Haste aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 4;
break;
}
case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS:
@@ -11617,6 +11628,9 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
sLog.outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId());
if (!HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown))
continue;
if (procDebug & 8)
sLog.outError("OverrideClassScripts aura of spell %d procs twice from one effect!",spellInfo->Id);
procDebug |= 8;
break;
}
case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: