Skip to content

Instantly share code, notes, and snippets.

View rsa's full-sized avatar

Сергей AKA /dev/rsa rsa

  • Murmansk, Russia
View GitHub Profile
@rsa
rsa / gist:1194915
Created September 5, 2011 12:51
stage 5 v 2
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp
index c84b2a3..f4a135b 100644
--- a/src/game/DynamicObject.cpp
+++ b/src/game/DynamicObject.cpp
@@ -170,7 +170,7 @@ void DynamicObject::Delay(int32 delaytime)
bool foundAura = false;
for (int32 i = m_effIndex + 1; i < MAX_EFFECT_INDEX; ++i)
{
- if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->m_auras[i])
+ if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
@rsa
rsa / gist:1197224
Created September 6, 2011 10:34
stage 4
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp
index c84b2a3..f4a135b 100644
--- a/src/game/DynamicObject.cpp
+++ b/src/game/DynamicObject.cpp
@@ -170,7 +170,7 @@ void DynamicObject::Delay(int32 delaytime)
bool foundAura = false;
for (int32 i = m_effIndex + 1; i < MAX_EFFECT_INDEX; ++i)
{
- if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->m_auras[i])
+ if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
@rsa
rsa / gist:1197298
Created September 6, 2011 11:17
stage 5
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index f8e8e8f..cd79f20 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -166,8 +166,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
{
if (!holder->GetAuraByEffectIndex(eff_index))
{
- PersistentAreaAura* Aur = new PersistentAreaAura(spellInfo, eff_index, NULL, holder, target, i_dynobject.GetCaster());
- holder->AddAura(Aur, eff_index);
@rsa
rsa / gist:1198256
Created September 6, 2011 17:15
dr_taunt
diff --git a/src/game/Creature.h b/src/game/Creature.h
index d5f4a3e..a081187 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -54,6 +54,7 @@ enum CreatureFlagsExtra
CREATURE_FLAG_EXTRA_AGGRO_ZONE = 0x00000200, // creature sets itself in combat with zone on aggro
CREATURE_FLAG_EXTRA_GUARD = 0x00000400, // creature is a guard
CREATURE_FLAG_EXTRA_KEEP_AI = 0x00001000, // creature keeps ScriptedAI even after being charmed / controlled (instead of getting PetAI)
+ CREATURE_FLAG_EXTRA_TAUNT_DIMINISHING = 0x00002000, // creature will only have Taunt diminishing returns if they have been specifically flagged (http://eu.battle.net/wow/en/game/patch-notes/3-3-0)
};
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 76ccc5b..30ea471 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3710,7 +3710,6 @@ void Unit::_UpdateSpells( uint32 time )
++m_spellAuraHoldersUpdateIterator; // need shift to next for allow update if need into aura update
if (i_holder && !i_holder->IsDeleted() && !i_holder->IsEmptyHolder() && !i_holder->IsInUse())
{
- MAPLOCK_READ(this,MAP_LOCK_TYPE_AURAS);
i_holder->UpdateHolder(time);
@rsa
rsa / gist:1200026
Created September 7, 2011 08:10
Locking stage 4 (full rewrite)
diff --git a/src/game/Map.h b/src/game/Map.h
index 3f0dcc4..041be71 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -22,8 +22,6 @@
#include "Common.h"
#include "Platform/Define.h"
#include "Policies/ThreadingModel.h"
-#include "ace/RW_Thread_Mutex.h"
-#include "ace/Thread_Mutex.h"
@rsa
rsa / gist:1205858
Created September 9, 2011 09:49
part 4 (small forget)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 570e1eb..37a4ed3 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -8907,7 +8907,7 @@ void Unit::UpdateVisibilityAndView()
static const AuraType auratypes[] = {SPELL_AURA_BIND_SIGHT, SPELL_AURA_FAR_SIGHT, SPELL_AURA_NONE};
for (AuraType const* type = &auratypes[0]; *type != SPELL_AURA_NONE; ++type)
{
- AuraList& alist = m_modAuras[*type];
+ AuraList alist = m_modAuras[*type];
@rsa
rsa / gist:1206088
Created September 9, 2011 12:29
preparation fix
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index e3134a8..fcd43d7 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -3483,3 +3483,12 @@ float Pet::OCTRegenMPPerSpirit()
float regen = spirit * moreRatio->ratio;
return regen;
}
+
+void ApplyArenaPreparationWithHelper::operator() (Unit* unit) const
@rsa
rsa / gist:1207206
Created September 9, 2011 20:14
stage 5
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp
index c84b2a3..f4a135b 100644
--- a/src/game/DynamicObject.cpp
+++ b/src/game/DynamicObject.cpp
@@ -170,7 +170,7 @@ void DynamicObject::Delay(int32 delaytime)
bool foundAura = false;
for (int32 i = m_effIndex + 1; i < MAX_EFFECT_INDEX; ++i)
{
- if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->m_auras[i])
+ if ((holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_PERSISTENT_AREA_AURA || holder->GetSpellProto()->Effect[i] == SPELL_EFFECT_ADD_FARSIGHT) && holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
@rsa
rsa / gist:1207215
Created September 9, 2011 20:15
stage5 sd2
diff --git a/base/BSW_ai.cpp b/base/BSW_ai.cpp
index de5f885..59d5145 100644
--- a/base/BSW_ai.cpp
+++ b/base/BSW_ai.cpp
@@ -751,9 +751,8 @@ bool BSWScriptedAI::_doAura(uint32 SpellID, Unit* pTarget, SpellEffectIndex inde
}
else
{
- aura = CreateAura(spell, index, &_basepoint, holder, pTarget);
+ aura = holder->CreateAura(spell, index, &_basepoint, pTarget, m_creature, NULL);