[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
@@ -175,10 +175,10 @@ public:
if (results.RowCount() == 1) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -187,8 +187,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
@@ -354,10 +354,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -366,8 +366,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";
@@ -394,10 +394,10 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
BlockedSpells e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.spellid = row[1] ? static_cast<uint32_t>(strtoul(row[1], nullptr, 10)) : 0;
e.type = static_cast<int8_t>(atoi(row[2]));
e.zoneid = static_cast<int32_t>(atoi(row[3]));
e.type = row[2] ? static_cast<int8_t>(atoi(row[2])) : 0;
e.zoneid = row[3] ? static_cast<int32_t>(atoi(row[3])) : 0;
e.x = row[4] ? strtof(row[4], nullptr) : 0;
e.y = row[5] ? strtof(row[5], nullptr) : 0;
e.z = row[6] ? strtof(row[6], nullptr) : 0;
@@ -406,8 +406,8 @@ public:
e.z_diff = row[9] ? strtof(row[9], nullptr) : 0;
e.message = row[10] ? row[10] : "";
e.description = row[11] ? row[11] : "";
e.min_expansion = static_cast<int8_t>(atoi(row[12]));
e.max_expansion = static_cast<int8_t>(atoi(row[13]));
e.min_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.max_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
e.content_flags = row[14] ? row[14] : "";
e.content_flags_disabled = row[15] ? row[15] : "";