diff options
author | Travis Howell | 2005-02-26 01:39:52 +0000 |
---|---|---|
committer | Travis Howell | 2005-02-26 01:39:52 +0000 |
commit | 4da8a6e1f05b9c2981465b7483fb677a84391e5f (patch) | |
tree | cb0088240e86bc454ceaf9aac4a38d0161be2a41 /scumm/sprite_he.cpp | |
parent | 574047157ae59f73d5c32eb1f843c9d3e9209af3 (diff) | |
download | scummvm-rg350-4da8a6e1f05b9c2981465b7483fb677a84391e5f.tar.gz scummvm-rg350-4da8a6e1f05b9c2981465b7483fb677a84391e5f.tar.bz2 scummvm-rg350-4da8a6e1f05b9c2981465b7483fb677a84391e5f.zip |
Fix sprite states
svn-id: r16921
Diffstat (limited to 'scumm/sprite_he.cpp')
-rw-r--r-- | scumm/sprite_he.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 736f061d15..3bfd649562 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -429,15 +429,13 @@ void ScummEngine_v90he::spriteInfoSet_field_80(int spriteId, int value) { _spriteTable[spriteId].field_80 = value; } -void ScummEngine_v90he::spriteInfoSet_resState(int spriteId, int value) { +void ScummEngine_v90he::spriteInfoSet_resState(int spriteId, int state) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); if (_spriteTable[spriteId].res_id) { - int state; - - state = MAX(value, _spriteTable[spriteId].res_wiz_states - 1); - if (state < 0) - state = 0; + int res_wiz_states = _spriteTable[spriteId].res_wiz_states - 1; + if (state > res_wiz_states) + state = res_wiz_states; if (_spriteTable[spriteId].res_state != state) { _spriteTable[spriteId].res_state = state; |