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

ELC: Fix ability score calculation from class stat bonuses #1706

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Next Next commit
Use correct class for calculating ability gain.
  • Loading branch information
jhett12321 committed Nov 5, 2023
commit db5ffc06dfe88c44f3f365ac0b9de88f3e929832
14 changes: 2 additions & 12 deletions Plugins/ELC/ELC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,9 @@ static auto s_ValidateCharacter = Hooks::HookFunction(&CNWSPlayer::ValidateChara
nAbilityAtLevel[nAbilityIndex] += nStatMods[nAbilityIndex];
}

for (int nMultiClass = 0; nMultiClass < NUM_MULTICLASS; nMultiClass++)
for (int nAbilityIndex = 0; nAbilityIndex <= Ability::MAX; nAbilityIndex++)
jhett12321 marked this conversation as resolved.
Show resolved Hide resolved
{
uint8_t nClassId = pCreatureStats->GetClass(nMultiClass);
CNWClass *pClass = nClassId < pRules->m_nNumClasses ? &pRules->m_lstClasses[nClassId] : nullptr;

if (pClass)
{
for (int nAbilityIndex = 0; nAbilityIndex < Ability::MAX; nAbilityIndex++)
{
nAbilityAtLevel[nAbilityIndex] += pClass->GetAbilityGainForSingleLevel(nAbilityIndex,
nMultiClassLevel[nMultiClassLeveledUpIn]);
}
}
nAbilityAtLevel[nAbilityIndex] += pClassLeveledUpIn->GetAbilityGainForSingleLevel(nAbilityIndex, nMultiClassLevel[nMultiClassLeveledUpIn]);
}

// *** Check Hit Die ********************************************************************************************************
Expand Down