Growlith1223 / ArsMagica2

Ars Magica 2 Bug Tracker
65 stars 31 forks source link

Frem Github Build: Arcane Affinity Not Reducing Manacost (Small Typo in Code) #180

Closed ProfHugo closed 7 years ago

ProfHugo commented 7 years ago

getAffinityDepth returns a float (?) between 0 and 1 for how deep the player affinity is, not 0-100, so this

if (pAffinity.getAffinityDepth(Affinity.ARCANE) > 50) {
    float reduction = (float) (1 - (0.5 * pAffinity.getAffinityDepth(Affinity.ARCANE)));
    cost *= reduction;
}

Will never run since getAffinityDepth cannot be more than 1, so I guess it should be 0.5 instead of 50

Note: This is getAffinityDepth:

public double getAffinityDepth(Affinity aff) {
    return DataSyncExtension.For(player).get(DataDefinitions.AFFINITY_DATA).get(aff) / MAX_DEPTH;
}

Where MAX_DEPTH is 100f

Growlith1223 commented 7 years ago

good catch, im fixing like 3 things at once here so excuse any derps like this

ProfHugo commented 7 years ago

don't rush it mate, keep up the good work!