diff options
author | Paul Gilbert | 2012-12-05 20:49:05 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-12-05 20:49:05 +1100 |
commit | 1f0e31d95ffa0cd072c06b31d37c4ef3014abb7e (patch) | |
tree | 786cb51009eb0882d284317e3f6611a02ffcbe3c | |
parent | e0711bb832b8224d261e21030eeceaafd91fbf6c (diff) | |
download | scummvm-rg350-1f0e31d95ffa0cd072c06b31d37c4ef3014abb7e.tar.gz scummvm-rg350-1f0e31d95ffa0cd072c06b31d37c4ef3014abb7e.tar.bz2 scummvm-rg350-1f0e31d95ffa0cd072c06b31d37c4ef3014abb7e.zip |
HOPKINS: Clean up shadowed variable in SCBOB
-rw-r--r-- | engines/hopkins/objects.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 6951f48a6f..9112245738 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -722,13 +722,11 @@ void ObjectsManager::SCBOB(int idx) { if (_vm->_globals.Cache[idx].fieldA <= 0) return; - int v1 = idx; - for (int v8 = 0; v8 <= 20; v8++) { - v1 = v8; - if ((_vm->_globals.Bob[v1].field0) && (!_vm->_globals.Bob[v8].field16) && (!_vm->_globals.Bob[v8].field34) && (_vm->_globals.Bob[v8].frameIndex != 250)) { - int v2 = _vm->_globals.Bob[v8].oldWidth; - int v9 = _vm->_globals.Bob[v8].oldX + _vm->_globals.Bob[v8].oldWidth; - int v6 = _vm->_globals.Bob[v8].oldY + _vm->_globals.Bob[v8].oldHeight; + for (int idx = 0; idx <= 20; idx++) { + if ((_vm->_globals.Bob[idx].field0) && (!_vm->_globals.Bob[idx].field16) && (!_vm->_globals.Bob[idx].field34) && (_vm->_globals.Bob[idx].frameIndex != 250)) { + int v2 = _vm->_globals.Bob[idx].oldWidth; + int v9 = _vm->_globals.Bob[idx].oldX + _vm->_globals.Bob[idx].oldWidth; + int v6 = _vm->_globals.Bob[idx].oldY + _vm->_globals.Bob[idx].oldHeight; int v3 =_vm->_globals.Cache[idx].field0; int v4 =_vm->_globals.Cache[idx].field4; int v7 =_vm->_globals.Cache[idx].field6 + v3; @@ -740,25 +738,25 @@ void ObjectsManager::SCBOB(int idx) { ++_vm->_globals.Cache[idx].fieldA; v1 = 1; } - if (!(uint16)v1) { + if (!v1) { if (v2 >= v3 && v7 >= v2) { ++_vm->_globals.Cache[idx].fieldA; v1 = 1; } } - if (!(uint16)v1) { + if (!v1) { if ( v7 >= v2 && v2 >= v3 ) { ++_vm->_globals.Cache[idx].fieldA; v1 = 1; } } - if (!(uint16)v1) { + if (!v1) { if (v2 >= v3 && v9 <= v7) { ++_vm->_globals.Cache[idx].fieldA; v1 = 1; } } - if (!(uint16)v1 && v2 <= v3 && v9 >= v7) + if (!v1 && v2 <= v3 && v9 >= v7) ++_vm->_globals.Cache[idx].fieldA; } } |