SHERLOCK: Add missing check for the rightmost limit in adjustSprite

This commit is contained in:
Filippos Karapetis 2015-06-08 01:23:23 +03:00
parent eb5579df54
commit e3d6b25d57

View File

@ -247,6 +247,11 @@ void Sprite::adjustSprite() {
_position.x = LEFT_LIMIT * FIXED_INT_MULTIPLIER;
people.gotoStand(*this);
}
if ((_position.x / FIXED_INT_MULTIPLIER) > RIGHT_LIMIT) {
_position.x = RIGHT_LIMIT * FIXED_INT_MULTIPLIER;
people.gotoStand(*this);
}
} else if (!map._active) {
_position.y = CLIP((int)_position.y, (int)UPPER_LIMIT, (int)LOWER_LIMIT);
_position.x = CLIP((int)_position.x, (int)LEFT_LIMIT, (int)RIGHT_LIMIT);