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:1223858
Created September 17, 2011 11:34
locking 5.3
diff --git a/src/game/ObjectLock.h b/src/game/ObjectLock.h
index 52ec319..2f48945 100644
--- a/src/game/ObjectLock.h
+++ b/src/game/ObjectLock.h
@@ -52,4 +52,8 @@ typedef ACE_Write_Guard<ObjectLockType> WriteGuard;
# define MAPLOCK_WRITE(OBJ,TYPE) WriteGuard Guard((OBJ)->GetLock(TYPE));
#endif
+#ifndef MAPLOCK_WRITE1
+# define MAPLOCK_WRITE1(OBJ,TYPE) WriteGuard Guard1((OBJ)->GetLock(TYPE));
@rsa
rsa / gist:1216379
Created September 14, 2011 11:46
attempt 2+N
diff --git a/src/game/MapPersistentStateMgr.cpp b/src/game/MapPersistentStateMgr.cpp
index 4d75890..f68e9e0 100644
--- a/src/game/MapPersistentStateMgr.cpp
+++ b/src/game/MapPersistentStateMgr.cpp
@@ -251,7 +251,7 @@ void DungeonPersistentState::SaveToDB()
}
}
- CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"UI64FMTD"', '%u', '%u', '%s')", GetInstanceId(), GetMapId(), (uint64)GetResetTime(), GetDifficulty(), GetCompletedEncountersMask(), data.c_str());
+ CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"UI64FMTD"', '%u', '%u', '%s')", GetInstanceId(), GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), GetCompletedEncountersMask(), data.c_str());
@rsa
rsa / gist:1213467
Created September 13, 2011 09:17
stage 5-2 sd2
diff --git a/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp
index d6dc511..986426d 100644
--- a/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp
+++ b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp
@@ -416,14 +416,6 @@ static VisionLocXY SkullIcecrownLoc[]=
// brain room portal loc:
// sara -> type_flags = 108; original
-// SanityAura, needs core support, not used here
-class MANGOS_DLL_DECL SanityAura : public Aura
@rsa
rsa / gist:1213463
Created September 13, 2011 09:15
stage 5-2
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index cd79f20..f847f57 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -166,7 +166,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target)
{
if (!holder->GetAuraByEffectIndex(eff_index))
{
- PersistentAreaAura* Aur = holder->CreatePersistentAreaAura(spellInfo, eff_index, NULL, target, i_dynobject.GetCaster());
+ Aura* Aur = holder->CreateAura(AURA_CLASS_PERSISTENT_AREA_AURA, eff_index, NULL, target, i_dynobject.GetCaster(), NULL);
@rsa
rsa / gist:1208663
Created September 10, 2011 19:13
stage 5 version 7
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);
@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: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: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: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"