Skip to content

Commit

Permalink
Plguins: Add IsServerSide property for CMaNGOS plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
sidsukana committed Feb 27, 2018
1 parent 0174c65 commit f6c9d2a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
4 changes: 2 additions & 2 deletions QSW/plugins/spellinfo/pre-tbc-cmangos/spellinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void SpellInfo::setModifiedSqlDataResult(quint8 queryIndex, QSqlQuery& query)
// add new index for meta spell
m_metaSpellIndexes.append(id);
m_internalSpells.append(id);
m_metaSpells.append(new Spell::meta(spell));
m_metaSpells.append(new Spell::meta(spell, true));

QString str = query.value(117).toString();
qint32 index = m_modifiedStrings.indexOf(str);
Expand Down Expand Up @@ -1279,4 +1279,4 @@ QVariantHash SpellInfo::getValues(quint32 id) const
values["effect"] = effectList;

return values;
}
}
7 changes: 6 additions & 1 deletion QSW/plugins/spellinfo/pre-tbc-cmangos/structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ namespace Spell

public:

meta(const entry* info) : m_info(info), m_destroyInfo(false) {}
meta(const entry* info, bool serverSide = false) : m_info(info), m_destroyInfo(false), m_serverSide(serverSide) {}

~meta()
{
Expand Down Expand Up @@ -430,6 +430,9 @@ namespace Spell
qint32 TriggerDuration(quint8 index) { return m_info->getTriggerDuration(index); }
QString NameWithRank() { return m_info->nameWithRank(); }

// Addition properties
bool IsServerSide() { return m_serverSide; }

bool hasAura(quint32 auraId)
{
for (quint8 i = 0; i < MAX_EFFECT_INDEX; ++i)
Expand Down Expand Up @@ -468,6 +471,7 @@ namespace Spell

const entry* m_info;
bool m_destroyInfo;
bool m_serverSide;

Q_PROPERTY(quint32 Id READ Id)
Q_PROPERTY(quint32 School READ School)
Expand Down Expand Up @@ -538,6 +542,7 @@ namespace Spell
Q_PROPERTY(quint32 RequiredAuraVision READ RequiredAuraVision)
Q_PROPERTY(qint32 Duration READ Duration)
Q_PROPERTY(QString NameWithRank READ NameWithRank)
Q_PROPERTY(bool IsServerSide READ IsServerSide)
};
}

Expand Down
2 changes: 1 addition & 1 deletion QSW/plugins/spellinfo/tbc-cmangos/spellinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void SpellInfo::setModifiedSqlDataResult(quint8 queryIndex, QSqlQuery& query)
// add new index for meta spell
m_metaSpellIndexes.append(id);
m_internalSpells.append(id);
m_metaSpells.append(new Spell::meta(spell));
m_metaSpells.append(new Spell::meta(spell, true));

QString str = query.value(124).toString();
qint32 index = m_modifiedStrings.indexOf(str);
Expand Down
7 changes: 6 additions & 1 deletion QSW/plugins/spellinfo/tbc-cmangos/structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ namespace Spell

public:

meta(const entry* info) : m_info(info), m_destroyInfo(false) {}
meta(const entry* info, bool serverSide = false) : m_info(info), m_destroyInfo(false), m_serverSide(serverSide) {}

~meta()
{
Expand Down Expand Up @@ -440,6 +440,9 @@ namespace Spell
qint32 TriggerDuration(quint8 index) { return m_info->getTriggerDuration(index); }
QString NameWithRank() { return m_info->nameWithRank(); }

// Addition properties
bool IsServerSide() { return m_serverSide; }

bool hasAura(quint32 auraId)
{
for (quint8 i = 0; i < MAX_EFFECT_INDEX; ++i)
Expand Down Expand Up @@ -478,6 +481,7 @@ namespace Spell

const entry* m_info;
bool m_destroyInfo;
bool m_serverSide;

Q_PROPERTY(quint32 Id READ Id)
Q_PROPERTY(quint32 Category READ Category)
Expand Down Expand Up @@ -555,6 +559,7 @@ namespace Spell
Q_PROPERTY(quint32 SchoolMask READ SchoolMask)
Q_PROPERTY(qint32 Duration READ Duration)
Q_PROPERTY(QString NameWithRank READ NameWithRank)
Q_PROPERTY(bool IsServerSide READ IsServerSide)
};
}

Expand Down
2 changes: 1 addition & 1 deletion QSW/plugins/spellinfo/wotlk-cmangos/spellinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void SpellInfo::setModifiedSqlDataResult(quint8 queryIndex, QSqlQuery& query)
// add new index for meta spell
m_metaSpellIndexes.append(id);
m_internalSpells.append(id);
m_metaSpells.append(new Spell::meta(spell));
m_metaSpells.append(new Spell::meta(spell, true));

QString str = query.value(133).toString();
qint32 index = m_modifiedStrings.indexOf(str);
Expand Down
7 changes: 6 additions & 1 deletion QSW/plugins/spellinfo/wotlk-cmangos/structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace Spell

public:

meta(const entry* info) : m_info(info), m_destroyInfo(false) {}
meta(const entry* info, bool serverSide = false) : m_info(info), m_destroyInfo(false), m_serverSide(serverSide) {}

~meta()
{
Expand Down Expand Up @@ -468,6 +468,9 @@ namespace Spell
qint32 TriggerDuration(quint8 index) { return m_info->getTriggerDuration(index); }
QString NameWithRank() { return m_info->nameWithRank(); }

// Addition properties
bool IsServerSide() { return m_serverSide; }

bool hasAura(quint32 auraId)
{
for (quint8 i = 0; i < MAX_EFFECT_INDEX; ++i)
Expand Down Expand Up @@ -506,6 +509,7 @@ namespace Spell

const entry* m_info;
bool m_destroyInfo;
bool m_serverSide;

Q_PROPERTY(quint32 Id READ Id)
Q_PROPERTY(quint32 Category READ Category)
Expand Down Expand Up @@ -591,6 +595,7 @@ namespace Spell
Q_PROPERTY(quint32 SpellDifficultyId READ SpellDifficultyId)
Q_PROPERTY(qint32 Duration READ Duration)
Q_PROPERTY(QString NameWithRank READ NameWithRank)
Q_PROPERTY(bool IsServerSide READ IsServerSide)
};
}

Expand Down

0 comments on commit f6c9d2a

Please sign in to comment.