diff options
author | Vladimir Menshakov | 2010-03-20 16:23:15 +0000 |
---|---|---|
committer | Vladimir Menshakov | 2010-03-20 16:23:15 +0000 |
commit | 9c2289b7a3d79e283d5e710d996557796f45511a (patch) | |
tree | 1fe152969bf1c8de6131bae17d3f112dc7552bc2 /engines/teenagent | |
parent | a61e36dcd2be51b3e1221d30b0dd29b95b8bdeed (diff) | |
download | scummvm-rg350-9c2289b7a3d79e283d5e710d996557796f45511a.tar.gz scummvm-rg350-9c2289b7a3d79e283d5e710d996557796f45511a.tar.bz2 scummvm-rg350-9c2289b7a3d79e283d5e710d996557796f45511a.zip |
flush inventory items on savegame load, fixing invalid item tiles after multiple loads.
svn-id: r48325
Diffstat (limited to 'engines/teenagent')
-rw-r--r-- | engines/teenagent/inventory.cpp | 4 | ||||
-rw-r--r-- | engines/teenagent/inventory.h | 1 | ||||
-rw-r--r-- | engines/teenagent/teenagent.cpp | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 21584394c6..3ffda1ac4c 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -115,6 +115,10 @@ void Inventory::clear() { } } +void Inventory::flush() { + for (int i = 0; i < 24; ++i) + graphics[i].free(); +} void Inventory::add(byte item) { if (has(item)) diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index c1f56e6f84..8b302055b8 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -42,6 +42,7 @@ public: void render(Graphics::Surface *surface, int delta); void clear(); + void flush(); void add(byte item); bool has(byte item) const; void remove(byte item); diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 43bb78c495..7f8c5b3ccc 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -213,6 +213,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) { scene->clear(); inventory->activate(false); + inventory->flush(); setMusic(Resources::instance()->dseg.get_byte(0xDB90)); |