aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-04-13 20:50:52 +0200
committerQAston <none@none>2009-04-13 20:50:52 +0200
commitf46d1b3b81e1d1b5cdca1d84f78fd9e39041a297 (patch)
treeee15ae5b11299bdb39f2e0c45868dfd8d788db91 /src
parentb972327979988d5221b51b22a120874107094324 (diff)
*Add some debug info to procflag
*Fix Sudden Death. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp9
-rw-r--r--src/game/Spell.cpp3
-rw-r--r--src/game/SpellAuras.cpp3
-rw-r--r--src/game/Unit.cpp14
4 files changed, 20 insertions, 9 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 2d7d98579a8..ae14d5ebc30 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -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())
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 33f4d05ea0e..4655d91b148 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -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
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index fb7d2c83f1c..767ed9dd744 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -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);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 33bcfa6d75c..6f57b27d567 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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: