Core/Misc: Some minor changes here and there

This commit is contained in:
Spp
2013-01-02 11:00:16 +01:00
parent d36c4a91ba
commit 5280a77fe1
8 changed files with 33 additions and 32 deletions

View File

@@ -1993,28 +1993,24 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
{
// Currently spawn numbering not different from map difficulty
Difficulty difficulty = GetDifficulty(aMap->IsRaid());
// some instances only have one difficulty
GetDownscaledMapDifficultyData(aMap->GetId(), difficulty);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId());
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
else
return NULL;
return GetBoundInstance(difficulty, aMap->GetId());
}
InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
{
if (!mapEntry)
if (!mapEntry || !mapEntry->IsDungeon())
return NULL;
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
return GetBoundInstance(difficulty, mapEntry->MapID);
}
InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
{
// some instances only have one difficulty
GetDownscaledMapDifficultyData(mapEntry->MapID, difficulty);
GetDownscaledMapDifficultyData(mapId, difficulty);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID);
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapId);
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
else

View File

@@ -301,6 +301,7 @@ class Group
InstanceGroupBind* GetBoundInstance(Player* player);
InstanceGroupBind* GetBoundInstance(Map* aMap);
InstanceGroupBind* GetBoundInstance(MapEntry const* mapEntry);
InstanceGroupBind* GetBoundInstance(Difficulty difficulty, uint32 mapId);
BoundInstancesMap& GetBoundInstances(Difficulty difficulty);
// FG: evil hacks

View File

@@ -418,7 +418,7 @@ enum SpellAttr4
SPELL_ATTR4_UNK5 = 0x00000020, // 5
SPELL_ATTR4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen
SPELL_ATTR4_TRIGGERED = 0x00000080, // 7 spells forced to be triggered
SPELL_ATTR4_UNK8 = 0x00000100, // 8 ignores taken percent damage mods?
SPELL_ATTR4_FIXED_DAMAGE = 0x00000100, // 8 ignores taken percent damage mods?
SPELL_ATTR4_TRIGGER_ACTIVATE = 0x00000200, // 9 initially disabled / trigger activate from event (Execute, Riposte, Deep Freeze end other)
SPELL_ATTR4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag
SPELL_ATTR4_UNK11 = 0x00000800, // 11
@@ -546,10 +546,10 @@ enum SpellAttr7
SPELL_ATTR7_UNK25 = 0x02000000, // 25
SPELL_ATTR7_UNK26 = 0x04000000, // 26
SPELL_ATTR7_UNK27 = 0x08000000, // 27 Not set
SPELL_ATTR7_UNK28 = 0x10000000, // 28 related to player positive buff
SPELL_ATTR7_BENEFIT_FROM_SPELLMOD = 0x10000000, // 28 Non-permanent, non-passive buffs that may benefit from spellmods
SPELL_ATTR7_UNK29 = 0x20000000, // 29 only 69028, 71237
SPELL_ATTR7_UNK30 = 0x40000000, // 30 Burning Determination, Divine Sacrifice, Earth Shield, Prayer of Mending
SPELL_ATTR7_UNK31 = 0x80000000 // 31 only 70769
SPELL_ATTR7_CLIENT_INDICATOR = 0x80000000
};
#define MIN_TALENT_SPEC 0
@@ -767,7 +767,7 @@ enum SpellEffects
SPELL_EFFECT_SUMMON_OBJECT_SLOT3 = 106,
SPELL_EFFECT_SUMMON_OBJECT_SLOT4 = 107,
SPELL_EFFECT_DISPEL_MECHANIC = 108,
SPELL_EFFECT_SUMMON_DEAD_PET = 109,
SPELL_EFFECT_RESURRECT_PET = 109,
SPELL_EFFECT_DESTROY_ALL_TOTEMS = 110,
SPELL_EFFECT_DURABILITY_DAMAGE = 111,
SPELL_EFFECT_112 = 112,

View File

@@ -141,15 +141,15 @@ namespace Movement
};
inline void MoveSplineInit::SetFly() { args.flags.EnableFlying(); }
inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable;}
inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom();}
inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true;}
inline void MoveSplineInit::SetWalk(bool enable) { args.flags.walkmode = enable; }
inline void MoveSplineInit::SetSmooth() { args.flags.EnableCatmullRom(); }
inline void MoveSplineInit::SetCyclic() { args.flags.cyclic = true; }
inline void MoveSplineInit::SetFall() { args.flags.EnableFalling();}
inline void MoveSplineInit::SetVelocity(float vel) { args.velocity = vel; args.HasVelocity = true; }
inline void MoveSplineInit::SetOrientationInversed() { args.flags.orientationInversed = true;}
inline void MoveSplineInit::SetTransportEnter() { args.flags.EnableTransportEnter(); }
inline void MoveSplineInit::SetTransportExit() { args.flags.EnableTransportExit(); }
inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable;}
inline void MoveSplineInit::SetOrientationFixed(bool enable) { args.flags.orientationFixed = enable; }
inline void MoveSplineInit::MovebyPath(const PointsArray& controls, int32 path_offset)
{
@@ -160,8 +160,7 @@ namespace Movement
inline void MoveSplineInit::MoveTo(float x, float y, float z)
{
Vector3 v(x, y, z);
MoveTo(v);
MoveTo(G3D::Vector3(x, y, z));
}
inline void MoveSplineInit::SetParabolic(float amplitude, float time_shift)

View File

@@ -817,11 +817,16 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar
return;
// choose which targets we can select at once
for (uint32 j = effIndex + 1; j < MAX_SPELL_EFFECTS; ++j)
if (GetSpellInfo()->Effects[effIndex].TargetA.GetTarget() == GetSpellInfo()->Effects[j].TargetA.GetTarget() &&
GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == GetSpellInfo()->Effects[j].TargetB.GetTarget() &&
GetSpellInfo()->Effects[effIndex].ImplicitTargetConditions == GetSpellInfo()->Effects[j].ImplicitTargetConditions &&
GetSpellInfo()->Effects[effIndex].CalcRadius(m_caster) == GetSpellInfo()->Effects[j].CalcRadius(m_caster))
{
SpellEffectInfo const* effects = GetSpellInfo()->Effects;
if (effects[effIndex].TargetA.GetTarget() == effects[j].TargetA.GetTarget()
&& effects[effIndex].TargetB.GetTarget() == effects[j].TargetB.GetTarget()
&& effects[effIndex].ImplicitTargetConditions == effects[j].ImplicitTargetConditions
&& effects[effIndex].CalcRadius(m_caster) == effects[j].CalcRadius(m_caster))
{
effectMask |= 1 << j;
}
}
processedEffectMask |= effectMask;
break;
default:
@@ -5243,7 +5248,7 @@ SpellCastResult Spell::CheckCast(bool strict)
}
break;
}
case SPELL_EFFECT_SUMMON_DEAD_PET:
case SPELL_EFFECT_RESURRECT_PET:
{
Creature* pet = m_caster->GetGuardianPet();

View File

@@ -1100,7 +1100,7 @@ bool SpellInfo::IsAffectedBySpellMods() const
return !(AttributesEx3 & SPELL_ATTR3_NO_DONE_BONUS);
}
bool SpellInfo::IsAffectedBySpellMod(SpellModifier* mod) const
bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
{
if (!IsAffectedBySpellMods())
return false;
@@ -2019,7 +2019,7 @@ uint32 SpellInfo::GetRecoveryTime() const
return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime;
}
uint32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const
int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const
{
// Spell drain all exist power on cast (Only paladin lay of Hands)
if (AttributesEx & SPELL_ATTR1_DRAIN_ALL_POWER)

View File

@@ -405,7 +405,7 @@ public:
bool IsAutoRepeatRangedSpell() const;
bool IsAffectedBySpellMods() const;
bool IsAffectedBySpellMod(SpellModifier* mod) const;
bool IsAffectedBySpellMod(SpellModifier const* mod) const;
bool CanPierceImmuneAura(SpellInfo const* aura) const;
bool CanDispelAura(SpellInfo const* aura) const;
@@ -445,7 +445,7 @@ public:
uint32 CalcCastTime(Unit* caster = NULL, Spell* spell = NULL) const;
uint32 GetRecoveryTime() const;
uint32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const;
int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const;
bool IsRanked() const;
uint8 GetRank() const;

View File

@@ -38,7 +38,7 @@ template<class VISITOR, class TYPE_CONTAINER> void VisitorHelper(VISITOR &v, TYP
}
// terminate condition for container list
template<class VISITOR> void VisitorHelper(VISITOR &v, ContainerList<TypeNull> &c)
template<class VISITOR> void VisitorHelper(VISITOR &/*v*/, ContainerList<TypeNull> &/*c*/)
{
}