diff --git a/src/Database.cpp b/src/Database.cpp index ed7cd17..85bebc0 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -1836,17 +1836,17 @@ bool Database::sendEmail(EmailData* data, std::vector attachments) { sqlite3_finalize(stmt); + sql = R"( + INSERT INTO EmailItems + (PlayerID, MsgIndex, Slot, ID, Type, Opt, TimeLimit) + VALUES (?, ?, ?, ?, ?, ?, ?); + )"; + + sqlite3_prepare_v2(db, sql, -1, &stmt, NULL); + // send attachments int slot = 1; for (sItemBase item : attachments) { - sql = R"( - INSERT INTO EmailItems - (PlayerID, MsgIndex, Slot, ID, Type, Opt, TimeLimit) - VALUES (?, ?, ?, ?, ?, ?, ?); - )"; - sqlite3_stmt* stmt; - - sqlite3_prepare_v2(db, sql, -1, &stmt, NULL); sqlite3_bind_int(stmt, 1, data->PlayerId); sqlite3_bind_int(stmt, 2, data->MsgIndex); sqlite3_bind_int(stmt, 3, slot++); diff --git a/tdata b/tdata index a6a3841..75d82f3 160000 --- a/tdata +++ b/tdata @@ -1 +1 @@ -Subproject commit a6a3841ff219ed57bbfda008782220ac4c111664 +Subproject commit 75d82f3155687d73ad72cfc479d2c2c7c3ecd20f