aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
authoruruk2014-06-14 19:46:18 +0200
committeruruk2014-06-14 19:46:18 +0200
commit3d63184fee4e8b533763ecf2cae187f76954ac97 (patch)
tree23658f1f6b4a553bab9a8fc6c7a285dc690a5fd7 /engines/cge2
parent28717ff056015d3aafdb1c91b7535cdc82a235cf (diff)
downloadscummvm-rg350-3d63184fee4e8b533763ecf2cae187f76954ac97.tar.gz
scummvm-rg350-3d63184fee4e8b533763ecf2cae187f76954ac97.tar.bz2
scummvm-rg350-3d63184fee4e8b533763ecf2cae187f76954ac97.zip
CGE2: Rethink Spare::dispose().
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/cge2_main.cpp2
-rw-r--r--engines/cge2/spare.cpp10
2 files changed, 1 insertions, 11 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index d9d22c84b1..9a736efdf0 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -370,7 +370,7 @@ void CGE2Engine::loadScript(const char *fname) {
int n = _spare->count();
if (_spare->locate(_sprite->_ref) == nullptr)
- _spare->store(_sprite);
+ _spare->dispose(_sprite);
_sprite = nullptr;
if (_spare->count() == n)
error("Durplicated reference! %s", SpN);
diff --git a/engines/cge2/spare.cpp b/engines/cge2/spare.cpp
index 63e85e8ed6..9531fe68f2 100644
--- a/engines/cge2/spare.cpp
+++ b/engines/cge2/spare.cpp
@@ -87,16 +87,6 @@ void Spare::dispose(Sprite *spr) {
if (spr) {
_vm->_vga->_showQ->remove(spr);
update(spr->contract());
- if (!_vm->isHero(spr)) {
- for (uint i = 0; i < _container.size(); ++i) {
- if (spr == _container[i]) {
- _container.remove_at(i);
- delete spr;
- spr = nullptr;
- break;
- }
- }
- }
}
}