diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-12 10:29:11 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-12 15:53:52 +0000 |
commit | cdcf0e2f9a8fb0e1c363fc65f71f3131fc6c5ea5 (patch) | |
tree | 3a665673235bb4dea58b99474492d90e0f711697 /modules/database/db_sql.cpp | |
parent | 718f2e922a6e1113d66fc6e96131213942d507b2 (diff) |
Move serialization from Serializable to a Serialize::Type child.
Diffstat (limited to 'modules/database/db_sql.cpp')
-rw-r--r-- | modules/database/db_sql.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/database/db_sql.cpp b/modules/database/db_sql.cpp index 4b120f3b0..b2d430fa2 100644 --- a/modules/database/db_sql.cpp +++ b/modules/database/db_sql.cpp @@ -113,8 +113,12 @@ public: { if (this->sql) { + Serialize::Type *s_type = obj->GetSerializableType(); + if (!s_type) + continue; + Data data; - obj->Serialize(data); + s_type->Serialize(obj, data); if (obj->IsCached(data)) continue; @@ -125,10 +129,6 @@ public: if (!this->loaded && !this->imported && !this->import) continue; - Serialize::Type *s_type = obj->GetSerializableType(); - if (!s_type) - continue; - auto create = this->sql->CreateTable(GetTableName(s_type), data); auto insert = this->sql->BuildInsert(GetTableName(s_type), obj->id, data); @@ -267,7 +267,7 @@ public: */ Data data2; - obj->Serialize(data2); + sb->Serialize(obj, data2); obj->UpdateCache(data2); /* We know this is the most up to date copy */ } } |