diff options
-rw-r--r-- | engines/cge2/spare.cpp | 6 | ||||
-rw-r--r-- | engines/cge2/spare.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/engines/cge2/spare.cpp b/engines/cge2/spare.cpp index 451cf21f9f..aff61b3f28 100644 --- a/engines/cge2/spare.cpp +++ b/engines/cge2/spare.cpp @@ -48,10 +48,10 @@ Sprite *Spare::locate(int ref) { return nullptr; } -void Spare::takeCave(int cav) { - int ref = cav << 8; +void Spare::takeCave(int ref) { Sprite *spr = locate(ref); - _vm->_vga->_showQ->insert(spr); + if (spr != nullptr) + _vm->_vga->_showQ->insert(spr); } void Spare::store(Sprite *spr) { diff --git a/engines/cge2/spare.h b/engines/cge2/spare.h index e1689c3d99..54683b9c65 100644 --- a/engines/cge2/spare.h +++ b/engines/cge2/spare.h @@ -40,7 +40,7 @@ public: ~Spare() { clear(); } void store(Sprite *spr); Sprite *locate(int ref); - void takeCave(int cav); + void takeCave(int ref); // Note that it takes the ref of the sprite now, not the number of the scene, like the original! void dispose(Sprite *spr); void dispose(int ref); void dispose(); |