Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Unable to set spell group to 'NONE' #4872

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ bool Spell::configureSpell(const pugi::xml_node& node)
spellId = pugi::cast<uint16_t>(attr.value());
}

if ((attr = node.attribute("aggressive"))) {
aggressive = booleanString(attr.as_string());
}

if (group == SPELLGROUP_NONE) {
group = (aggressive ? SPELLGROUP_ATTACK : SPELLGROUP_HEALING);
}

if ((attr = node.attribute("group"))) {
std::string tmpStr = boost::algorithm::to_lower_copy<std::string>(attr.as_string());
if (tmpStr == "none" || tmpStr == "0") {
Expand All @@ -390,7 +398,7 @@ bool Spell::configureSpell(const pugi::xml_node& node)
}
}

if ((attr = node.attribute("groupcooldown"))) {
if (group != SPELLGROUP_NONE && (attr = node.attribute("groupcooldown"))) {
groupCooldown = pugi::cast<uint32_t>(attr.value());
}

Expand All @@ -411,7 +419,7 @@ bool Spell::configureSpell(const pugi::xml_node& node)
}
}

if ((attr = node.attribute("secondarygroupcooldown"))) {
if (secondaryGroup != SPELLGROUP_NONE && (attr = node.attribute("secondarygroupcooldown"))) {
secondaryGroupCooldown = pugi::cast<uint32_t>(attr.value());
}

Expand Down Expand Up @@ -491,14 +499,6 @@ bool Spell::configureSpell(const pugi::xml_node& node)
pzLock = booleanString(attr.as_string());
}

if ((attr = node.attribute("aggressive"))) {
aggressive = booleanString(attr.as_string());
}

if (group == SPELLGROUP_NONE) {
group = (aggressive ? SPELLGROUP_ATTACK : SPELLGROUP_HEALING);
}

for (auto vocationNode : node.children()) {
if (!(attr = vocationNode.attribute("name"))) {
continue;
Expand Down
Loading