Input: Fix isRepeated off-by-one error and do small optim.

This commit is contained in:
Jonas Kulla 2014-09-03 02:35:57 +02:00
parent d2d86e7002
commit 10186e8dcc
1 changed files with 3 additions and 4 deletions

View File

@ -601,12 +601,11 @@ void Input::update()
bool repeated;
if (rgssVer >= 2)
repeated = p->repeatCount >= 24 && (p->repeatCount % 6) == 0;
repeated = p->repeatCount >= 23 && ((p->repeatCount+1) % 6) == 0;
else
repeated = p->repeatCount >= 16 && (p->repeatCount % 4) == 0;
repeated = p->repeatCount >= 15 && ((p->repeatCount+1) % 4) == 0;
if (repeated)
p->getState(p->repeating).repeated = true;
p->getState(p->repeating).repeated |= repeated;
return;
}