diff options
-rw-r--r-- | engines/cge2/cge2_main.cpp | 4 | ||||
-rw-r--r-- | engines/cge2/hero.h | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 5d4a97fd80..75b9affc1a 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -619,7 +619,7 @@ void CGE2Engine::tick() { void CGE2Engine::openPocket() { for (int i = 0; i < 2; i++) { for (int j = 0; j < kPocketMax + 1; j++) { - int ref = (int)_heroTab[i]->_pocket[j]; + int ref = (int)_heroTab[i]->_downPocketId[j]; _heroTab[i]->_pocket[j] = (ref == -1) ? nullptr : _vga->_showQ->locate(ref); } } @@ -629,7 +629,7 @@ void CGE2Engine::closePocket() { for (int i = 0; i < 2; i++) { for (int j = 0; j < kPocketMax + 1; j++) { Sprite *spr = _heroTab[i]->_pocket[j]; - _heroTab[i]->_pocket[j] = (Sprite*)((spr) ? spr->_ref : -1); + _heroTab[i]->_downPocketId[j] = (spr) ? spr->_ref : -1; } } } diff --git a/engines/cge2/hero.h b/engines/cge2/hero.h index 2998d7efe1..41eb3ac020 100644 --- a/engines/cge2/hero.h +++ b/engines/cge2/hero.h @@ -41,13 +41,16 @@ struct HeroTab { Hero *_ptr; Sprite *_face; Sprite *_pocket[kPocketMax + 1]; + int _downPocketId[kPocketMax + 1]; int _pocPtr; V2D *_posTab[kSceneMax]; HeroTab(CGE2Engine *vm) { _ptr = nullptr; _face = nullptr; - for (int i = 0; i < kPocketMax + 1; i++) + for (int i = 0; i < kPocketMax + 1; i++) { _pocket[i] = nullptr; + _downPocketId[i] = -1; + } _pocPtr = 0; for (int i = 0; i < kSceneMax; i++) _posTab[i] = nullptr; |