Core/Spells: added a bunch of default ctors for several spellMgr structs to silence uninitialized member warnings

This commit is contained in:
Ovahlord
2022-02-21 10:50:00 +01:00
parent 33bc96fcce
commit 97a79175fc
2 changed files with 28 additions and 21 deletions

View File

@@ -1710,24 +1710,18 @@ void SpellMgr::LoadSpellProcs()
TC_LOG_INFO("server.loading", ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
// Define can trigger auras
bool isTriggerAura[TOTAL_AURAS];
bool isTriggerAura[TOTAL_AURAS] = { };
// Triggered always, even from triggered spells
bool isAlwaysTriggeredAura[TOTAL_AURAS];
bool isAlwaysTriggeredAura[TOTAL_AURAS] = { };
// SpellTypeMask to add to the proc
uint32 spellTypeMask[TOTAL_AURAS];
std::array<uint32, TOTAL_AURAS> spellTypeMask = { };
spellTypeMask.fill(PROC_SPELL_TYPE_MASK_ALL);
// List of auras that CAN trigger but may not exist in spell_proc
// in most cases needed to drop charges
// some aura types need additional checks (eg SPELL_AURA_MECHANIC_IMMUNITY needs mechanic check)
// see AuraEffect::CheckEffectProc
for (uint16 i = 0; i < TOTAL_AURAS; ++i)
{
isTriggerAura[i] = false;
isAlwaysTriggeredAura[i] = false;
spellTypeMask[i] = PROC_SPELL_TYPE_MASK_ALL;
}
isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting, but there are some exceptions (ie 12311)
isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets"
isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus
@@ -2624,7 +2618,7 @@ void SpellMgr::UnloadSpellInfoImplicitTargetConditionLists()
void SpellMgr::UnloadSpellAreaConditions()
{
for (auto spellAreaData : mSpellAreaForAreaMap)
for (auto& spellAreaData : mSpellAreaForAreaMap)
spellAreaData.second->Conditions.clear();
}
@@ -3252,13 +3246,12 @@ void SpellMgr::LoadSpellInfoCorrections()
});
// Tree of Life passives
ApplySpellFix({
5420,
81097
}, [](SpellInfo* spellInfo)
{
spellInfo->Stances = 1 << (FORM_TREE - 1);
spellInfo->Stances = uint64(1 << (FORM_TREE - 1));
});
// Elemental Oath

View File

@@ -277,10 +277,12 @@ enum EnchantProcAttributes
struct SpellEnchantProcEntry
{
float Chance; // if nonzero - overwrite SpellItemEnchantment value
float ProcsPerMinute; // if nonzero - chance to proc is equal to value * aura caster's weapon speed / 60
uint32 HitMask; // if nonzero - bitmask for matching proc condition based on hit result, see enum ProcFlagsHit
uint32 AttributesMask; // bitmask, see EnchantProcAttributes
SpellEnchantProcEntry() : Chance(0.f), ProcsPerMinute(0.f), HitMask(0), AttributesMask(0.f) { }
float Chance; // if nonzero - overwrite SpellItemEnchantment value
float ProcsPerMinute; // if nonzero - chance to proc is equal to value * aura caster's weapon speed / 60
uint32 HitMask; // if nonzero - bitmask for matching proc condition based on hit result, see enum ProcFlagsHit
uint32 AttributesMask; // bitmask, see EnchantProcAttributes
};
typedef std::unordered_map<uint32, SpellEnchantProcEntry> SpellEnchantProcEventMap;
@@ -343,9 +345,11 @@ typedef std::unordered_map<SpellGroup, std::unordered_set<uint32 /*auraName*/>>
struct SpellThreatEntry
{
int32 flatMod; // flat threat-value for this Spell - default: 0
float pctMod; // threat-multiplier for this Spell - default: 1.0f
float apPctMod; // Pct of AP that is added as Threat - default: 0.0f
SpellThreatEntry() : flatMod(0), pctMod(1.f), apPctMod(0.f) { }
int32 flatMod; // flat threat-value for this Spell - default: 0
float pctMod; // threat-multiplier for this Spell - default: 1.0f
float apPctMod; // Pct of AP that is added as Threat - default: 0.0f
};
typedef std::unordered_map<uint32, SpellThreatEntry> SpellThreatMap;
@@ -353,6 +357,8 @@ typedef std::unordered_map<uint32, SpellThreatEntry> SpellThreatMap;
// coordinates for spells (accessed using SpellMgr functions)
struct SpellTargetPosition
{
SpellTargetPosition() : target_mapId(0), target_X(0.f), target_Y(0.f), target_Z(0.f), target_Orientation(0.f) { }
uint32 target_mapId;
float target_X;
float target_Y;
@@ -509,6 +515,8 @@ typedef std::pair<SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::cons
// Spell rank chain (accessed using SpellMgr functions)
struct SpellChainNode
{
SpellChainNode() : prev(nullptr), next(nullptr), first(nullptr), last(nullptr), rank(0) { }
SpellInfo const* prev;
SpellInfo const* next;
SpellInfo const* first;
@@ -529,6 +537,8 @@ typedef std::pair<SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellM
// Spell learning properties (accessed using SpellMgr functions)
struct SpellLearnSkillNode
{
SpellLearnSkillNode() : skill(0), step(0), value(0), maxvalue(0) { }
uint16 skill;
uint16 step;
uint16 value; // 0 - max skill value for player level
@@ -539,6 +549,8 @@ typedef std::unordered_map<uint32, SpellLearnSkillNode> SpellLearnSkillMap;
struct SpellLearnSpellNode
{
SpellLearnSpellNode() : spell(0), active(false), autoLearned(false) { }
uint32 spell;
bool active; // show in spellbook or not
bool autoLearned;
@@ -557,7 +569,9 @@ typedef std::map<uint32, uint32> SpellDifficultySearcherMap;
struct PetDefaultSpellsEntry
{
uint32 spellid[MAX_CREATURE_SPELL_DATA_SLOT];
PetDefaultSpellsEntry() : spellid({ }) { }
std::array<uint32, MAX_CREATURE_SPELL_DATA_SLOT> spellid;
};
// < 0 for petspelldata id, > 0 for creature_id