Check for negative value

svn-id: r17070
This commit is contained in:
Travis Howell 2005-03-11 03:21:43 +00:00
parent d6b8386241
commit 06a8268792

View file

@ -85,8 +85,7 @@ int ScummEngine_v90he::findSpriteWithClassOf(int x_pos, int y_pos, int spriteGro
if (spi->field_80) {
int16 x1, x2, y1, y2;
state = getWizImageStates(spi->field_80);
state /= spi->cur_img_state;
state = spi->cur_img_state / getWizImageStates(spi->field_80);
x = x_pos - spi->pos.x;
y = y_pos - spi->pos.y;
@ -450,8 +449,8 @@ void ScummEngine_v90he::spriteInfoSet_resState(int spriteId, int state) {
if (_spriteTable[spriteId].res_id) {
int res_wiz_states = _spriteTable[spriteId].res_wiz_states - 1;
if (state > res_wiz_states)
state = res_wiz_states;
state = MAX(0, state);
state = MIN(state, res_wiz_states);
if (_spriteTable[spriteId].res_state != state) {
_spriteTable[spriteId].res_state = state;