[Repositories] Fix datetime zero-value save behavior (#3976)

This commit is contained in:
Chris Miles
2024-01-14 00:10:13 -06:00
committed by GitHub
parent e40267b9b8
commit 14509fcc4e
133 changed files with 3647 additions and 3658 deletions
@@ -135,8 +135,8 @@ public:
if (results.RowCount() == 1) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;
@@ -274,8 +274,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;
@@ -304,8 +304,8 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Graveyard e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.zone_id = static_cast<int32_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.zone_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.x = row[2] ? strtof(row[2], nullptr) : 0;
e.y = row[3] ? strtof(row[3], nullptr) : 0;
e.z = row[4] ? strtof(row[4], nullptr) : 0;