Fix skills usage slots

Closes #110
This commit is contained in:
Alexander Batalov 2022-08-02 12:09:33 +03:00
parent 28a433ea76
commit 66d46bd8a5
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
@ -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];
}
}