KYRA: (LOL) - fix LoLEngine::updateCompass()

This commit is contained in:
athrxx 2014-03-17 21:28:59 +01:00
parent 2e8f2ba822
commit e53a2b18e9

View File

@ -620,14 +620,14 @@ void LoLEngine::updateCompass() {
if (_compassStep)
_compassStep -= (((ABS(_compassStep) >> 4) + 2) * dir);
int16 d = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection;
if (d <= -128)
d += 256;
if (d >= 128)
d -= 256;
int16 diff = _compassBroken ? (int8(_rnd.getRandomNumber(255)) - _compassDirection) : (_currentDirection << 6) - _compassDirection;
if (diff <= -128)
diff += 256;
if (diff >= 128)
diff -= 256;
d >>= 2;
_compassStep += d;
diff >>= 2;
_compassStep += diff;
_compassStep = CLIP(_compassStep, -24, 24);
_compassDirection += _compassStep;
@ -636,14 +636,9 @@ void LoLEngine::updateCompass() {
if (_compassDirection > 255)
_compassDirection -= 256;
if ((_compassDirection >> 6) == _currentDirection && _compassStep < 2) {
int16 d2 = d >> 16;
d ^= d2;
d -= d2;
if (d < 4) {
_compassDirection = _currentDirection << 6;
_compassStep = 0;
}
if (((((_compassDirection + 3) & 0xFD) >> 6) == _currentDirection) && (_compassStep < 2) && (ABS(diff) < 4)) {
_compassDirection = _currentDirection << 6;
_compassStep = 0;
}
gui_drawCompass();