diff --git a/modules/mod-Forge/src/ForgeCache.cpp b/modules/mod-Forge/src/ForgeCache.cpp index 395571d4baa24d..64e212b9cde557 100644 --- a/modules/mod-Forge/src/ForgeCache.cpp +++ b/modules/mod-Forge/src/ForgeCache.cpp @@ -947,6 +947,7 @@ class ForgeCache : public DatabaseScript uint8 row; uint8 col; uint8 pointReq; + uint8 nodeIndex; std::vector unlocks; }; struct TreeMetaData { @@ -1561,6 +1562,7 @@ class ForgeCache : public DatabaseScript node->pointReq = newTalent->TabPointReq; node->col = newTalent->ColumnIndex; node->row = newTalent->RowIndex; + node->nodeIndex = newTalent->nodeIndex; data->nodes[node->row][node->col] = node; data->nodeLocation[node->spellId] = node; diff --git a/modules/mod-Forge/src/TopicHandlers/LearnTalentHandler.cpp b/modules/mod-Forge/src/TopicHandlers/LearnTalentHandler.cpp index 401228cb3c2a80..7886dd29f39128 100644 --- a/modules/mod-Forge/src/TopicHandlers/LearnTalentHandler.cpp +++ b/modules/mod-Forge/src/TopicHandlers/LearnTalentHandler.cpp @@ -141,10 +141,9 @@ class LearnTalentHandler : public ForgeTopicHandler auto rankedSpell = ft->Ranks[ct->CurrentRank]; if (!iam.player->HasSpell(ct->SpellId)) { if (choiceNode) { - iam.player->learnSpell(ct->SpellId); - - uint32 choiceId = fc->GetChoiceNodeFromindex(ct->CurrentRank); - spec->ChoiceNodesChosen[ct->SpellId] = choiceId; + auto choice = fc->_choiceNodes[ct->SpellId][ct->CurrentRank - 1]; + iam.player->learnSpell(choice); + spec->ChoiceNodesChosen[ct->SpellId] = choice; } else { iam.player->learnSpell(rankedSpell); @@ -217,8 +216,8 @@ class LearnTalentHandler : public ForgeTopicHandler bool choiceNode = talent->nodeType == NodeType::CHOICE; if (col.second > 0) { if (choiceNode) { - uint32 choiceId = fc->GetChoiceNodeFromindex(col.second); - if (!choiceId) { + auto choiceId = fc->_choiceNodes.find(node->spellId); + if (choiceId == fc->_choiceNodes.end()) { player->SendForgeUIMsg(ForgeTopic::LEARN_TALENT_ERROR, "Unknown choice node received."); return false; }