summaryrefslogtreecommitdiff
path: root/modules/database/db_sql_live.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/database/db_sql_live.cpp')
-rw-r--r--modules/database/db_sql_live.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/database/db_sql_live.cpp b/modules/database/db_sql_live.cpp
index 1b4b7c6cd..3473fc1a9 100644
--- a/modules/database/db_sql_live.cpp
+++ b/modules/database/db_sql_live.cpp
@@ -106,9 +106,12 @@ class DBMySQL : public Module, public Pipe
this->RunQueryResult(create[i]);
SQLResult res = this->RunQueryResult(this->SQL->BuildInsert(this->prefix + s_type->GetName(), obj->id, data));
- if (res.GetID() > 0)
+ if (obj->id != res.GetID())
+ {
+ /* In this case obj is new, so place it into the object map */
obj->id = res.GetID();
- s_type->objects.erase(obj->id);
+ s_type->objects[obj->id] = obj;
+ }
}
}