mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
GRIM: Fix unknown key error when loading savegame
This commit is contained in:
+4
-3
@@ -314,9 +314,10 @@ void PoolObject<T>::Pool::restoreObjects(SaveGame *state) {
|
||||
Common::HashMap<int32, T *> tempMap;
|
||||
for (int32 i = 0; i < size; ++i) {
|
||||
int32 id = state->readLESint32();
|
||||
T *t = _map.getVal(id);
|
||||
_map.erase(id);
|
||||
if (!t) {
|
||||
T *t = nullptr;
|
||||
if (_map.tryGetVal(id, t))
|
||||
_map.erase(id);
|
||||
else {
|
||||
t = new T();
|
||||
t->setId(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user