[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
@@ -255,40 +255,40 @@ public:
if (results.RowCount() == 1) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";
@@ -514,40 +514,40 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";
@@ -574,40 +574,40 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Doors e{};
e.id = static_cast<int32_t>(atoi(row[0]));
e.doorid = static_cast<int16_t>(atoi(row[1]));
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.doorid = row[1] ? static_cast<int16_t>(atoi(row[1])) : 0;
e.zone = row[2] ? row[2] : "";
e.version = static_cast<int16_t>(atoi(row[3]));
e.version = row[3] ? static_cast<int16_t>(atoi(row[3])) : 0;
e.name = row[4] ? row[4] : "";
e.pos_y = row[5] ? strtof(row[5], nullptr) : 0;
e.pos_x = row[6] ? strtof(row[6], nullptr) : 0;
e.pos_z = row[7] ? strtof(row[7], nullptr) : 0;
e.heading = row[8] ? strtof(row[8], nullptr) : 0;
e.opentype = static_cast<int16_t>(atoi(row[9]));
e.guild = static_cast<int16_t>(atoi(row[10]));
e.lockpick = static_cast<int16_t>(atoi(row[11]));
e.keyitem = static_cast<int32_t>(atoi(row[12]));
e.opentype = row[9] ? static_cast<int16_t>(atoi(row[9])) : 0;
e.guild = row[10] ? static_cast<int16_t>(atoi(row[10])) : 0;
e.lockpick = row[11] ? static_cast<int16_t>(atoi(row[11])) : 0;
e.keyitem = row[12] ? static_cast<int32_t>(atoi(row[12])) : 0;
e.nokeyring = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.triggerdoor = static_cast<int16_t>(atoi(row[14]));
e.triggertype = static_cast<int16_t>(atoi(row[15]));
e.disable_timer = static_cast<int8_t>(atoi(row[16]));
e.doorisopen = static_cast<int16_t>(atoi(row[17]));
e.door_param = static_cast<int32_t>(atoi(row[18]));
e.dest_zone = row[19] ? row[19] : "";
e.triggerdoor = row[14] ? static_cast<int16_t>(atoi(row[14])) : 0;
e.triggertype = row[15] ? static_cast<int16_t>(atoi(row[15])) : 0;
e.disable_timer = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.doorisopen = row[17] ? static_cast<int16_t>(atoi(row[17])) : 0;
e.door_param = row[18] ? static_cast<int32_t>(atoi(row[18])) : 0;
e.dest_zone = row[19] ? row[19] : "NONE";
e.dest_instance = row[20] ? static_cast<uint32_t>(strtoul(row[20], nullptr, 10)) : 0;
e.dest_x = row[21] ? strtof(row[21], nullptr) : 0;
e.dest_y = row[22] ? strtof(row[22], nullptr) : 0;
e.dest_z = row[23] ? strtof(row[23], nullptr) : 0;
e.dest_heading = row[24] ? strtof(row[24], nullptr) : 0;
e.invert_state = static_cast<int32_t>(atoi(row[25]));
e.incline = static_cast<int32_t>(atoi(row[26]));
e.invert_state = row[25] ? static_cast<int32_t>(atoi(row[25])) : 0;
e.incline = row[26] ? static_cast<int32_t>(atoi(row[26])) : 0;
e.size = row[27] ? static_cast<uint16_t>(strtoul(row[27], nullptr, 10)) : 100;
e.buffer = row[28] ? strtof(row[28], nullptr) : 0;
e.client_version_mask = row[29] ? static_cast<uint32_t>(strtoul(row[29], nullptr, 10)) : 4294967295;
e.is_ldon_door = static_cast<int16_t>(atoi(row[30]));
e.dz_switch_id = static_cast<int32_t>(atoi(row[31]));
e.min_expansion = static_cast<int8_t>(atoi(row[32]));
e.max_expansion = static_cast<int8_t>(atoi(row[33]));
e.is_ldon_door = row[30] ? static_cast<int16_t>(atoi(row[30])) : 0;
e.dz_switch_id = row[31] ? static_cast<int32_t>(atoi(row[31])) : 0;
e.min_expansion = row[32] ? static_cast<int8_t>(atoi(row[32])) : -1;
e.max_expansion = row[33] ? static_cast<int8_t>(atoi(row[33])) : -1;
e.content_flags = row[34] ? row[34] : "";
e.content_flags_disabled = row[35] ? row[35] : "";