From 9ec482b7c298e86589a333b856aa5578a3004f6e Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 7 Nov 2012 22:20:48 -0500 Subject: [PATCH] I haven't a clue why this was here but its not even remotely right.. fixes #1448 --- modules/database/db_sql_live.cpp | 7 +++++-- 1 file 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; + } } }