From 66d46bd8a5ca090ba15b6cbefe4b83fc7248f83c Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Tue, 2 Aug 2022 12:09:33 +0300 Subject: [PATCH] Fix skills usage slots Closes #110 --- src/skill.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/skill.cc b/src/skill.cc index ab3f02a..d3ea37f 100644 --- a/src/skill.cc +++ b/src/skill.cc @@ -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]; } }