Skip to content

Commit

Permalink
Fix skills usage slots
Browse files Browse the repository at this point in the history
Closes #110
  • Loading branch information
alexbatalov committed Aug 2, 2022
1 parent 28a433e commit 66d46bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/skill.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ static int skillGetFreeUsageSlot(int skill)
}

int time = gameTimeGetTime();
int hoursSinceLastUsage = (time - _timesSkillUsed[skill][SKILLS_MAX_USES_PER_DAY - 1]) / 36000;
int hoursSinceLastUsage = (time - _timesSkillUsed[skill][0]) / GAME_TIME_TICKS_PER_HOUR;
if (hoursSinceLastUsage <= 24) {
return -1;
}
Expand All @@ -1162,7 +1162,7 @@ int skillUpdateLastUse(int skill)
}

if (_timesSkillUsed[skill][slot] != 0) {
for (int i = 0; i < slot - 1; i++) {
for (int i = 0; i < slot; i++) {
_timesSkillUsed[skill][i] = _timesSkillUsed[skill][i + 1];
}
}
Expand Down

0 comments on commit 66d46bd

Please sign in to comment.