Skip to content

Commit

Permalink
Fix skill time calculation
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
Kev committed Feb 2, 2014
1 parent 8727c16 commit 31f7134
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Controllers/SkillLevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ int SkillLevel::getSkillPointsForLevel() const {
}

int SkillLevel::getSkillPointsTrained() const {
return (skillPoints_ >= 0) ? skillPoints_ : rawLevelPoints(level_);
return (skillPoints_ >= 0) ? skillPoints_ : (rawLevelPoints(level_ - 1) * getSkill()->getRank());
}

int SkillLevel::getRemainingSkillPoints() const {
int multiplier = getSkill()->getRank();
int points = getSkillPointsForLevel() - getSkillPointsTrained();
points *= multiplier;
return points;
}

Expand Down
1 change: 1 addition & 0 deletions Controllers/SkillTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace EveXin {
if (attributeModifier == 0) {
// Something has gone badly wrong. Perhaps corrupt character data,
// or skills that don't exist any more. Regardless, let's not blow up.
std::cerr << "WARNING: attribute modifier error" << std::endl;
attributeModifier = 1;
}
float minutes = pointsNeeded / attributeModifier;
Expand Down

0 comments on commit 31f7134

Please sign in to comment.