diff --git a/common/repositories/base/base_adventure_template_repository.h b/common/repositories/base/base_adventure_template_repository.h index 41c5df27b..0f15813da 100644 --- a/common/repositories/base/base_adventure_template_repository.h +++ b/common/repositories/base/base_adventure_template_repository.h @@ -238,10 +238,10 @@ public: entry.type = atoi(row[7]); entry.type_data = atoi(row[8]); entry.type_count = atoi(row[9]); - entry.assa_x = atof(row[10]); - entry.assa_y = atof(row[11]); - entry.assa_z = atof(row[12]); - entry.assa_h = atof(row[13]); + entry.assa_x = static_cast(atof(row[10])); + entry.assa_y = static_cast(atof(row[11])); + entry.assa_z = static_cast(atof(row[12])); + entry.assa_h = static_cast(atof(row[13])); entry.text = row[14] ? row[14] : ""; entry.duration = atoi(row[15]); entry.zone_in_time = atoi(row[16]); @@ -249,18 +249,18 @@ public: entry.lose_points = atoi(row[18]); entry.theme = atoi(row[19]); entry.zone_in_zone_id = atoi(row[20]); - entry.zone_in_x = atof(row[21]); - entry.zone_in_y = atof(row[22]); + entry.zone_in_x = static_cast(atof(row[21])); + entry.zone_in_y = static_cast(atof(row[22])); entry.zone_in_object_id = atoi(row[23]); - entry.dest_x = atof(row[24]); - entry.dest_y = atof(row[25]); - entry.dest_z = atof(row[26]); - entry.dest_h = atof(row[27]); + entry.dest_x = static_cast(atof(row[24])); + entry.dest_y = static_cast(atof(row[25])); + entry.dest_z = static_cast(atof(row[26])); + entry.dest_h = static_cast(atof(row[27])); entry.graveyard_zone_id = atoi(row[28]); - entry.graveyard_x = atof(row[29]); - entry.graveyard_y = atof(row[30]); - entry.graveyard_z = atof(row[31]); - entry.graveyard_radius = atof(row[32]); + entry.graveyard_x = static_cast(atof(row[29])); + entry.graveyard_y = static_cast(atof(row[30])); + entry.graveyard_z = static_cast(atof(row[31])); + entry.graveyard_radius = static_cast(atof(row[32])); return entry; } @@ -482,10 +482,10 @@ public: entry.type = atoi(row[7]); entry.type_data = atoi(row[8]); entry.type_count = atoi(row[9]); - entry.assa_x = atof(row[10]); - entry.assa_y = atof(row[11]); - entry.assa_z = atof(row[12]); - entry.assa_h = atof(row[13]); + entry.assa_x = static_cast(atof(row[10])); + entry.assa_y = static_cast(atof(row[11])); + entry.assa_z = static_cast(atof(row[12])); + entry.assa_h = static_cast(atof(row[13])); entry.text = row[14] ? row[14] : ""; entry.duration = atoi(row[15]); entry.zone_in_time = atoi(row[16]); @@ -493,18 +493,18 @@ public: entry.lose_points = atoi(row[18]); entry.theme = atoi(row[19]); entry.zone_in_zone_id = atoi(row[20]); - entry.zone_in_x = atof(row[21]); - entry.zone_in_y = atof(row[22]); + entry.zone_in_x = static_cast(atof(row[21])); + entry.zone_in_y = static_cast(atof(row[22])); entry.zone_in_object_id = atoi(row[23]); - entry.dest_x = atof(row[24]); - entry.dest_y = atof(row[25]); - entry.dest_z = atof(row[26]); - entry.dest_h = atof(row[27]); + entry.dest_x = static_cast(atof(row[24])); + entry.dest_y = static_cast(atof(row[25])); + entry.dest_z = static_cast(atof(row[26])); + entry.dest_h = static_cast(atof(row[27])); entry.graveyard_zone_id = atoi(row[28]); - entry.graveyard_x = atof(row[29]); - entry.graveyard_y = atof(row[30]); - entry.graveyard_z = atof(row[31]); - entry.graveyard_radius = atof(row[32]); + entry.graveyard_x = static_cast(atof(row[29])); + entry.graveyard_y = static_cast(atof(row[30])); + entry.graveyard_z = static_cast(atof(row[31])); + entry.graveyard_radius = static_cast(atof(row[32])); all_entries.push_back(entry); } @@ -539,10 +539,10 @@ public: entry.type = atoi(row[7]); entry.type_data = atoi(row[8]); entry.type_count = atoi(row[9]); - entry.assa_x = atof(row[10]); - entry.assa_y = atof(row[11]); - entry.assa_z = atof(row[12]); - entry.assa_h = atof(row[13]); + entry.assa_x = static_cast(atof(row[10])); + entry.assa_y = static_cast(atof(row[11])); + entry.assa_z = static_cast(atof(row[12])); + entry.assa_h = static_cast(atof(row[13])); entry.text = row[14] ? row[14] : ""; entry.duration = atoi(row[15]); entry.zone_in_time = atoi(row[16]); @@ -550,18 +550,18 @@ public: entry.lose_points = atoi(row[18]); entry.theme = atoi(row[19]); entry.zone_in_zone_id = atoi(row[20]); - entry.zone_in_x = atof(row[21]); - entry.zone_in_y = atof(row[22]); + entry.zone_in_x = static_cast(atof(row[21])); + entry.zone_in_y = static_cast(atof(row[22])); entry.zone_in_object_id = atoi(row[23]); - entry.dest_x = atof(row[24]); - entry.dest_y = atof(row[25]); - entry.dest_z = atof(row[26]); - entry.dest_h = atof(row[27]); + entry.dest_x = static_cast(atof(row[24])); + entry.dest_y = static_cast(atof(row[25])); + entry.dest_z = static_cast(atof(row[26])); + entry.dest_h = static_cast(atof(row[27])); entry.graveyard_zone_id = atoi(row[28]); - entry.graveyard_x = atof(row[29]); - entry.graveyard_y = atof(row[30]); - entry.graveyard_z = atof(row[31]); - entry.graveyard_radius = atof(row[32]); + entry.graveyard_x = static_cast(atof(row[29])); + entry.graveyard_y = static_cast(atof(row[30])); + entry.graveyard_z = static_cast(atof(row[31])); + entry.graveyard_radius = static_cast(atof(row[32])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_blocked_spells_repository.h b/common/repositories/base/base_blocked_spells_repository.h index 8f24ed9f0..50e6a682e 100644 --- a/common/repositories/base/base_blocked_spells_repository.h +++ b/common/repositories/base/base_blocked_spells_repository.h @@ -169,12 +169,12 @@ public: entry.spellid = atoi(row[1]); entry.type = atoi(row[2]); entry.zoneid = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.x_diff = atof(row[7]); - entry.y_diff = atof(row[8]); - entry.z_diff = atof(row[9]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.x_diff = static_cast(atof(row[7])); + entry.y_diff = static_cast(atof(row[8])); + entry.z_diff = static_cast(atof(row[9])); entry.message = row[10] ? row[10] : ""; entry.description = row[11] ? row[11] : ""; @@ -326,12 +326,12 @@ public: entry.spellid = atoi(row[1]); entry.type = atoi(row[2]); entry.zoneid = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.x_diff = atof(row[7]); - entry.y_diff = atof(row[8]); - entry.z_diff = atof(row[9]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.x_diff = static_cast(atof(row[7])); + entry.y_diff = static_cast(atof(row[8])); + entry.z_diff = static_cast(atof(row[9])); entry.message = row[10] ? row[10] : ""; entry.description = row[11] ? row[11] : ""; @@ -362,12 +362,12 @@ public: entry.spellid = atoi(row[1]); entry.type = atoi(row[2]); entry.zoneid = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.x_diff = atof(row[7]); - entry.y_diff = atof(row[8]); - entry.z_diff = atof(row[9]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.x_diff = static_cast(atof(row[7])); + entry.y_diff = static_cast(atof(row[8])); + entry.z_diff = static_cast(atof(row[9])); entry.message = row[10] ? row[10] : ""; entry.description = row[11] ? row[11] : ""; diff --git a/common/repositories/base/base_bug_reports_repository.h b/common/repositories/base/base_bug_reports_repository.h index 779327ef9..c70d897f2 100644 --- a/common/repositories/base/base_bug_reports_repository.h +++ b/common/repositories/base/base_bug_reports_repository.h @@ -237,9 +237,9 @@ public: entry.category_name = row[9] ? row[9] : ""; entry.reporter_name = row[10] ? row[10] : ""; entry.ui_path = row[11] ? row[11] : ""; - entry.pos_x = atof(row[12]); - entry.pos_y = atof(row[13]); - entry.pos_z = atof(row[14]); + entry.pos_x = static_cast(atof(row[12])); + entry.pos_y = static_cast(atof(row[13])); + entry.pos_z = static_cast(atof(row[14])); entry.heading = atoi(row[15]); entry.time_played = atoi(row[16]); entry.target_id = atoi(row[17]); @@ -474,9 +474,9 @@ public: entry.category_name = row[9] ? row[9] : ""; entry.reporter_name = row[10] ? row[10] : ""; entry.ui_path = row[11] ? row[11] : ""; - entry.pos_x = atof(row[12]); - entry.pos_y = atof(row[13]); - entry.pos_z = atof(row[14]); + entry.pos_x = static_cast(atof(row[12])); + entry.pos_y = static_cast(atof(row[13])); + entry.pos_z = static_cast(atof(row[14])); entry.heading = atoi(row[15]); entry.time_played = atoi(row[16]); entry.target_id = atoi(row[17]); @@ -530,9 +530,9 @@ public: entry.category_name = row[9] ? row[9] : ""; entry.reporter_name = row[10] ? row[10] : ""; entry.ui_path = row[11] ? row[11] : ""; - entry.pos_x = atof(row[12]); - entry.pos_y = atof(row[13]); - entry.pos_z = atof(row[14]); + entry.pos_x = static_cast(atof(row[12])); + entry.pos_y = static_cast(atof(row[13])); + entry.pos_z = static_cast(atof(row[14])); entry.heading = atoi(row[15]); entry.time_played = atoi(row[16]); entry.target_id = atoi(row[17]); diff --git a/common/repositories/base/base_bugs_repository.h b/common/repositories/base/base_bugs_repository.h index 664097890..4bcab8c66 100644 --- a/common/repositories/base/base_bugs_repository.h +++ b/common/repositories/base/base_bugs_repository.h @@ -172,9 +172,9 @@ public: entry.zone = row[1] ? row[1] : ""; entry.name = row[2] ? row[2] : ""; entry.ui = row[3] ? row[3] : ""; - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); entry.type = row[7] ? row[7] : ""; entry.flag = atoi(row[8]); entry.target = row[9] ? row[9] : ""; @@ -333,9 +333,9 @@ public: entry.zone = row[1] ? row[1] : ""; entry.name = row[2] ? row[2] : ""; entry.ui = row[3] ? row[3] : ""; - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); entry.type = row[7] ? row[7] : ""; entry.flag = atoi(row[8]); entry.target = row[9] ? row[9] : ""; @@ -370,9 +370,9 @@ public: entry.zone = row[1] ? row[1] : ""; entry.name = row[2] ? row[2] : ""; entry.ui = row[3] ? row[3] : ""; - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); entry.type = row[7] ? row[7] : ""; entry.flag = atoi(row[8]); entry.target = row[9] ? row[9] : ""; diff --git a/common/repositories/base/base_character_bind_repository.h b/common/repositories/base/base_character_bind_repository.h index 9994cb2b2..911545a6f 100644 --- a/common/repositories/base/base_character_bind_repository.h +++ b/common/repositories/base/base_character_bind_repository.h @@ -157,10 +157,10 @@ public: entry.slot = atoi(row[1]); entry.zone_id = atoi(row[2]); entry.instance_id = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); return entry; } @@ -298,10 +298,10 @@ public: entry.slot = atoi(row[1]); entry.zone_id = atoi(row[2]); entry.instance_id = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); all_entries.push_back(entry); } @@ -330,10 +330,10 @@ public: entry.slot = atoi(row[1]); entry.zone_id = atoi(row[2]); entry.instance_id = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_character_corpses_repository.h b/common/repositories/base/base_character_corpses_repository.h index c9d46ff52..db64a58fa 100644 --- a/common/repositories/base/base_character_corpses_repository.h +++ b/common/repositories/base/base_character_corpses_repository.h @@ -275,10 +275,10 @@ public: entry.charname = row[2] ? row[2] : ""; entry.zone_id = atoi(row[3]); entry.instance_id = atoi(row[4]); - entry.x = atof(row[5]); - entry.y = atof(row[6]); - entry.z = atof(row[7]); - entry.heading = atof(row[8]); + entry.x = static_cast(atof(row[5])); + entry.y = static_cast(atof(row[6])); + entry.z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.time_of_death = row[9] ? row[9] : ""; entry.guild_consent_id = atoi(row[10]); entry.is_rezzed = atoi(row[11]); @@ -572,10 +572,10 @@ public: entry.charname = row[2] ? row[2] : ""; entry.zone_id = atoi(row[3]); entry.instance_id = atoi(row[4]); - entry.x = atof(row[5]); - entry.y = atof(row[6]); - entry.z = atof(row[7]); - entry.heading = atof(row[8]); + entry.x = static_cast(atof(row[5])); + entry.y = static_cast(atof(row[6])); + entry.z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.time_of_death = row[9] ? row[9] : ""; entry.guild_consent_id = atoi(row[10]); entry.is_rezzed = atoi(row[11]); @@ -643,10 +643,10 @@ public: entry.charname = row[2] ? row[2] : ""; entry.zone_id = atoi(row[3]); entry.instance_id = atoi(row[4]); - entry.x = atof(row[5]); - entry.y = atof(row[6]); - entry.z = atof(row[7]); - entry.heading = atof(row[8]); + entry.x = static_cast(atof(row[5])); + entry.y = static_cast(atof(row[6])); + entry.z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.time_of_death = row[9] ? row[9] : ""; entry.guild_consent_id = atoi(row[10]); entry.is_rezzed = atoi(row[11]); diff --git a/common/repositories/base/base_character_data_repository.h b/common/repositories/base/base_character_data_repository.h index 489af6ca3..e6c59579a 100644 --- a/common/repositories/base/base_character_data_repository.h +++ b/common/repositories/base/base_character_data_repository.h @@ -443,10 +443,10 @@ public: entry.suffix = row[5] ? row[5] : ""; entry.zone_id = atoi(row[6]); entry.zone_instance = atoi(row[7]); - entry.y = atof(row[8]); - entry.x = atof(row[9]); - entry.z = atof(row[10]); - entry.heading = atof(row[11]); + entry.y = static_cast(atof(row[8])); + entry.x = static_cast(atof(row[9])); + entry.z = static_cast(atof(row[10])); + entry.heading = static_cast(atof(row[11])); entry.gender = atoi(row[12]); entry.race = atoi(row[13]); entry.class = atoi(row[14]); @@ -960,10 +960,10 @@ public: entry.suffix = row[5] ? row[5] : ""; entry.zone_id = atoi(row[6]); entry.zone_instance = atoi(row[7]); - entry.y = atof(row[8]); - entry.x = atof(row[9]); - entry.z = atof(row[10]); - entry.heading = atof(row[11]); + entry.y = static_cast(atof(row[8])); + entry.x = static_cast(atof(row[9])); + entry.z = static_cast(atof(row[10])); + entry.heading = static_cast(atof(row[11])); entry.gender = atoi(row[12]); entry.race = atoi(row[13]); entry.class = atoi(row[14]); @@ -1086,10 +1086,10 @@ public: entry.suffix = row[5] ? row[5] : ""; entry.zone_id = atoi(row[6]); entry.zone_instance = atoi(row[7]); - entry.y = atof(row[8]); - entry.x = atof(row[9]); - entry.z = atof(row[10]); - entry.heading = atof(row[11]); + entry.y = static_cast(atof(row[8])); + entry.x = static_cast(atof(row[9])); + entry.z = static_cast(atof(row[10])); + entry.heading = static_cast(atof(row[11])); entry.gender = atoi(row[12]); entry.race = atoi(row[13]); entry.class = atoi(row[14]); diff --git a/common/repositories/base/base_character_pet_info_repository.h b/common/repositories/base/base_character_pet_info_repository.h index 3b7f5baea..b4d795745 100644 --- a/common/repositories/base/base_character_pet_info_repository.h +++ b/common/repositories/base/base_character_pet_info_repository.h @@ -160,7 +160,7 @@ public: entry.spell_id = atoi(row[4]); entry.hp = atoi(row[5]); entry.mana = atoi(row[6]); - entry.size = atof(row[7]); + entry.size = static_cast(atof(row[7])); return entry; } @@ -304,7 +304,7 @@ public: entry.spell_id = atoi(row[4]); entry.hp = atoi(row[5]); entry.mana = atoi(row[6]); - entry.size = atof(row[7]); + entry.size = static_cast(atof(row[7])); all_entries.push_back(entry); } @@ -336,7 +336,7 @@ public: entry.spell_id = atoi(row[4]); entry.hp = atoi(row[5]); entry.mana = atoi(row[6]); - entry.size = atof(row[7]); + entry.size = static_cast(atof(row[7])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_doors_repository.h b/common/repositories/base/base_doors_repository.h index ea08eba8d..3ca9dcd86 100644 --- a/common/repositories/base/base_doors_repository.h +++ b/common/repositories/base/base_doors_repository.h @@ -236,10 +236,10 @@ public: entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); entry.name = row[4] ? row[4] : ""; - entry.pos_y = atof(row[5]); - entry.pos_x = atof(row[6]); - entry.pos_z = atof(row[7]); - entry.heading = atof(row[8]); + entry.pos_y = static_cast(atof(row[5])); + entry.pos_x = static_cast(atof(row[6])); + entry.pos_z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.opentype = atoi(row[9]); entry.guild = atoi(row[10]); entry.lockpick = atoi(row[11]); @@ -252,14 +252,14 @@ public: entry.door_param = atoi(row[18]); entry.dest_zone = row[19] ? row[19] : ""; entry.dest_instance = atoi(row[20]); - entry.dest_x = atof(row[21]); - entry.dest_y = atof(row[22]); - entry.dest_z = atof(row[23]); - entry.dest_heading = atof(row[24]); + entry.dest_x = static_cast(atof(row[21])); + entry.dest_y = static_cast(atof(row[22])); + entry.dest_z = static_cast(atof(row[23])); + entry.dest_heading = static_cast(atof(row[24])); entry.invert_state = atoi(row[25]); entry.incline = atoi(row[26]); entry.size = atoi(row[27]); - entry.buffer = atof(row[28]); + entry.buffer = static_cast(atof(row[28])); entry.client_version_mask = atoi(row[29]); entry.is_ldon_door = atoi(row[30]); entry.min_expansion = atoi(row[31]); @@ -481,10 +481,10 @@ public: entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); entry.name = row[4] ? row[4] : ""; - entry.pos_y = atof(row[5]); - entry.pos_x = atof(row[6]); - entry.pos_z = atof(row[7]); - entry.heading = atof(row[8]); + entry.pos_y = static_cast(atof(row[5])); + entry.pos_x = static_cast(atof(row[6])); + entry.pos_z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.opentype = atoi(row[9]); entry.guild = atoi(row[10]); entry.lockpick = atoi(row[11]); @@ -497,14 +497,14 @@ public: entry.door_param = atoi(row[18]); entry.dest_zone = row[19] ? row[19] : ""; entry.dest_instance = atoi(row[20]); - entry.dest_x = atof(row[21]); - entry.dest_y = atof(row[22]); - entry.dest_z = atof(row[23]); - entry.dest_heading = atof(row[24]); + entry.dest_x = static_cast(atof(row[21])); + entry.dest_y = static_cast(atof(row[22])); + entry.dest_z = static_cast(atof(row[23])); + entry.dest_heading = static_cast(atof(row[24])); entry.invert_state = atoi(row[25]); entry.incline = atoi(row[26]); entry.size = atoi(row[27]); - entry.buffer = atof(row[28]); + entry.buffer = static_cast(atof(row[28])); entry.client_version_mask = atoi(row[29]); entry.is_ldon_door = atoi(row[30]); entry.min_expansion = atoi(row[31]); @@ -539,10 +539,10 @@ public: entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); entry.name = row[4] ? row[4] : ""; - entry.pos_y = atof(row[5]); - entry.pos_x = atof(row[6]); - entry.pos_z = atof(row[7]); - entry.heading = atof(row[8]); + entry.pos_y = static_cast(atof(row[5])); + entry.pos_x = static_cast(atof(row[6])); + entry.pos_z = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.opentype = atoi(row[9]); entry.guild = atoi(row[10]); entry.lockpick = atoi(row[11]); @@ -555,14 +555,14 @@ public: entry.door_param = atoi(row[18]); entry.dest_zone = row[19] ? row[19] : ""; entry.dest_instance = atoi(row[20]); - entry.dest_x = atof(row[21]); - entry.dest_y = atof(row[22]); - entry.dest_z = atof(row[23]); - entry.dest_heading = atof(row[24]); + entry.dest_x = static_cast(atof(row[21])); + entry.dest_y = static_cast(atof(row[22])); + entry.dest_z = static_cast(atof(row[23])); + entry.dest_heading = static_cast(atof(row[24])); entry.invert_state = atoi(row[25]); entry.incline = atoi(row[26]); entry.size = atoi(row[27]); - entry.buffer = atof(row[28]); + entry.buffer = static_cast(atof(row[28])); entry.client_version_mask = atoi(row[29]); entry.is_ldon_door = atoi(row[30]); entry.min_expansion = atoi(row[31]); diff --git a/common/repositories/base/base_graveyard_repository.h b/common/repositories/base/base_graveyard_repository.h index 0ed2eca7a..ca6aad86b 100644 --- a/common/repositories/base/base_graveyard_repository.h +++ b/common/repositories/base/base_graveyard_repository.h @@ -149,10 +149,10 @@ public: entry.id = atoi(row[0]); entry.zone_id = atoi(row[1]); - entry.x = atof(row[2]); - entry.y = atof(row[3]); - entry.z = atof(row[4]); - entry.heading = atof(row[5]); + entry.x = static_cast(atof(row[2])); + entry.y = static_cast(atof(row[3])); + entry.z = static_cast(atof(row[4])); + entry.heading = static_cast(atof(row[5])); return entry; } @@ -282,10 +282,10 @@ public: entry.id = atoi(row[0]); entry.zone_id = atoi(row[1]); - entry.x = atof(row[2]); - entry.y = atof(row[3]); - entry.z = atof(row[4]); - entry.heading = atof(row[5]); + entry.x = static_cast(atof(row[2])); + entry.y = static_cast(atof(row[3])); + entry.z = static_cast(atof(row[4])); + entry.heading = static_cast(atof(row[5])); all_entries.push_back(entry); } @@ -312,10 +312,10 @@ public: entry.id = atoi(row[0]); entry.zone_id = atoi(row[1]); - entry.x = atof(row[2]); - entry.y = atof(row[3]); - entry.z = atof(row[4]); - entry.heading = atof(row[5]); + entry.x = static_cast(atof(row[2])); + entry.y = static_cast(atof(row[3])); + entry.z = static_cast(atof(row[4])); + entry.heading = static_cast(atof(row[5])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_ground_spawns_repository.h b/common/repositories/base/base_ground_spawns_repository.h index 3d9ee9977..7e21389fe 100644 --- a/common/repositories/base/base_ground_spawns_repository.h +++ b/common/repositories/base/base_ground_spawns_repository.h @@ -183,12 +183,12 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.max_x = atof(row[3]); - entry.max_y = atof(row[4]); - entry.max_z = atof(row[5]); - entry.min_x = atof(row[6]); - entry.min_y = atof(row[7]); - entry.heading = atof(row[8]); + entry.max_x = static_cast(atof(row[3])); + entry.max_y = static_cast(atof(row[4])); + entry.max_z = static_cast(atof(row[5])); + entry.min_x = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.name = row[9] ? row[9] : ""; entry.item = atoi(row[10]); entry.max_allowed = atoi(row[11]); @@ -360,12 +360,12 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.max_x = atof(row[3]); - entry.max_y = atof(row[4]); - entry.max_z = atof(row[5]); - entry.min_x = atof(row[6]); - entry.min_y = atof(row[7]); - entry.heading = atof(row[8]); + entry.max_x = static_cast(atof(row[3])); + entry.max_y = static_cast(atof(row[4])); + entry.max_z = static_cast(atof(row[5])); + entry.min_x = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.name = row[9] ? row[9] : ""; entry.item = atoi(row[10]); entry.max_allowed = atoi(row[11]); @@ -401,12 +401,12 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.max_x = atof(row[3]); - entry.max_y = atof(row[4]); - entry.max_z = atof(row[5]); - entry.min_x = atof(row[6]); - entry.min_y = atof(row[7]); - entry.heading = atof(row[8]); + entry.max_x = static_cast(atof(row[3])); + entry.max_y = static_cast(atof(row[4])); + entry.max_z = static_cast(atof(row[5])); + entry.min_x = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); + entry.heading = static_cast(atof(row[8])); entry.name = row[9] ? row[9] : ""; entry.item = atoi(row[10]); entry.max_allowed = atoi(row[11]); diff --git a/common/repositories/base/base_items_repository.h b/common/repositories/base/base_items_repository.h index fe36db64a..29884ec16 100644 --- a/common/repositories/base/base_items_repository.h +++ b/common/repositories/base/base_items_repository.h @@ -296,7 +296,7 @@ public: std::string bardname; int bardunk7; int UNK214; - int UNK219; + int subtype; int UNK220; int UNK221; int heirloom; @@ -591,7 +591,7 @@ public: "bardname", "bardunk7", "UNK214", - "UNK219", + "subtype", "UNK220", "UNK221", "heirloom", @@ -926,7 +926,7 @@ public: entry.bardname = ""; entry.bardunk7 = 0; entry.UNK214 = 0; - entry.UNK219 = 0; + entry.subtype = 0; entry.UNK220 = 0; entry.UNK221 = 0; entry.heirloom = 0; @@ -1091,7 +1091,7 @@ public: entry.reclevel = atoi(row[104]); entry.recskill = atoi(row[105]); entry.reqlevel = atoi(row[106]); - entry.sellrate = atof(row[107]); + entry.sellrate = static_cast(atof(row[107])); entry.shielding = atoi(row[108]); entry.size = atoi(row[109]); entry.skillmodtype = atoi(row[110]); @@ -1245,7 +1245,7 @@ public: entry.bardname = row[258] ? row[258] : ""; entry.bardunk7 = atoi(row[259]); entry.UNK214 = atoi(row[260]); - entry.UNK219 = atoi(row[261]); + entry.subtype = atoi(row[261]); entry.UNK220 = atoi(row[262]); entry.UNK221 = atoi(row[263]); entry.heirloom = atoi(row[264]); @@ -1561,7 +1561,7 @@ public: update_values.push_back(columns[258] + " = '" + EscapeString(items_entry.bardname) + "'"); update_values.push_back(columns[259] + " = " + std::to_string(items_entry.bardunk7)); update_values.push_back(columns[260] + " = " + std::to_string(items_entry.UNK214)); - update_values.push_back(columns[261] + " = " + std::to_string(items_entry.UNK219)); + update_values.push_back(columns[261] + " = " + std::to_string(items_entry.subtype)); update_values.push_back(columns[262] + " = " + std::to_string(items_entry.UNK220)); update_values.push_back(columns[263] + " = " + std::to_string(items_entry.UNK221)); update_values.push_back(columns[264] + " = " + std::to_string(items_entry.heirloom)); @@ -1866,7 +1866,7 @@ public: insert_values.push_back("'" + EscapeString(items_entry.bardname) + "'"); insert_values.push_back(std::to_string(items_entry.bardunk7)); insert_values.push_back(std::to_string(items_entry.UNK214)); - insert_values.push_back(std::to_string(items_entry.UNK219)); + insert_values.push_back(std::to_string(items_entry.subtype)); insert_values.push_back(std::to_string(items_entry.UNK220)); insert_values.push_back(std::to_string(items_entry.UNK221)); insert_values.push_back(std::to_string(items_entry.heirloom)); @@ -2179,7 +2179,7 @@ public: insert_values.push_back("'" + EscapeString(items_entry.bardname) + "'"); insert_values.push_back(std::to_string(items_entry.bardunk7)); insert_values.push_back(std::to_string(items_entry.UNK214)); - insert_values.push_back(std::to_string(items_entry.UNK219)); + insert_values.push_back(std::to_string(items_entry.subtype)); insert_values.push_back(std::to_string(items_entry.UNK220)); insert_values.push_back(std::to_string(items_entry.UNK221)); insert_values.push_back(std::to_string(items_entry.heirloom)); @@ -2343,7 +2343,7 @@ public: entry.reclevel = atoi(row[104]); entry.recskill = atoi(row[105]); entry.reqlevel = atoi(row[106]); - entry.sellrate = atof(row[107]); + entry.sellrate = static_cast(atof(row[107])); entry.shielding = atoi(row[108]); entry.size = atoi(row[109]); entry.skillmodtype = atoi(row[110]); @@ -2497,7 +2497,7 @@ public: entry.bardname = row[258] ? row[258] : ""; entry.bardunk7 = atoi(row[259]); entry.UNK214 = atoi(row[260]); - entry.UNK219 = atoi(row[261]); + entry.subtype = atoi(row[261]); entry.UNK220 = atoi(row[262]); entry.UNK221 = atoi(row[263]); entry.heirloom = atoi(row[264]); @@ -2652,7 +2652,7 @@ public: entry.reclevel = atoi(row[104]); entry.recskill = atoi(row[105]); entry.reqlevel = atoi(row[106]); - entry.sellrate = atof(row[107]); + entry.sellrate = static_cast(atof(row[107])); entry.shielding = atoi(row[108]); entry.size = atoi(row[109]); entry.skillmodtype = atoi(row[110]); @@ -2806,7 +2806,7 @@ public: entry.bardname = row[258] ? row[258] : ""; entry.bardunk7 = atoi(row[259]); entry.UNK214 = atoi(row[260]); - entry.UNK219 = atoi(row[261]); + entry.subtype = atoi(row[261]); entry.UNK220 = atoi(row[262]); entry.UNK221 = atoi(row[263]); entry.heirloom = atoi(row[264]); diff --git a/common/repositories/base/base_level_exp_mods_repository.h b/common/repositories/base/base_level_exp_mods_repository.h index a25bd1fb0..4a77e47dc 100644 --- a/common/repositories/base/base_level_exp_mods_repository.h +++ b/common/repositories/base/base_level_exp_mods_repository.h @@ -139,8 +139,8 @@ public: LevelExpMods entry{}; entry.level = atoi(row[0]); - entry.exp_mod = atof(row[1]); - entry.aa_exp_mod = atof(row[2]); + entry.exp_mod = static_cast(atof(row[1])); + entry.aa_exp_mod = static_cast(atof(row[2])); return entry; } @@ -263,8 +263,8 @@ public: LevelExpMods entry{}; entry.level = atoi(row[0]); - entry.exp_mod = atof(row[1]); - entry.aa_exp_mod = atof(row[2]); + entry.exp_mod = static_cast(atof(row[1])); + entry.aa_exp_mod = static_cast(atof(row[2])); all_entries.push_back(entry); } @@ -290,8 +290,8 @@ public: LevelExpMods entry{}; entry.level = atoi(row[0]); - entry.exp_mod = atof(row[1]); - entry.aa_exp_mod = atof(row[2]); + entry.exp_mod = static_cast(atof(row[1])); + entry.aa_exp_mod = static_cast(atof(row[2])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_lootdrop_entries_repository.h b/common/repositories/base/base_lootdrop_entries_repository.h index 830a9ea49..c513956e8 100644 --- a/common/repositories/base/base_lootdrop_entries_repository.h +++ b/common/repositories/base/base_lootdrop_entries_repository.h @@ -160,8 +160,8 @@ public: entry.item_id = atoi(row[1]); entry.item_charges = atoi(row[2]); entry.equip_item = atoi(row[3]); - entry.chance = atof(row[4]); - entry.disabled_chance = atof(row[5]); + entry.chance = static_cast(atof(row[4])); + entry.disabled_chance = static_cast(atof(row[5])); entry.minlevel = atoi(row[6]); entry.maxlevel = atoi(row[7]); entry.multiplier = atoi(row[8]); @@ -308,8 +308,8 @@ public: entry.item_id = atoi(row[1]); entry.item_charges = atoi(row[2]); entry.equip_item = atoi(row[3]); - entry.chance = atof(row[4]); - entry.disabled_chance = atof(row[5]); + entry.chance = static_cast(atof(row[4])); + entry.disabled_chance = static_cast(atof(row[5])); entry.minlevel = atoi(row[6]); entry.maxlevel = atoi(row[7]); entry.multiplier = atoi(row[8]); @@ -341,8 +341,8 @@ public: entry.item_id = atoi(row[1]); entry.item_charges = atoi(row[2]); entry.equip_item = atoi(row[3]); - entry.chance = atof(row[4]); - entry.disabled_chance = atof(row[5]); + entry.chance = static_cast(atof(row[4])); + entry.disabled_chance = static_cast(atof(row[5])); entry.minlevel = atoi(row[6]); entry.maxlevel = atoi(row[7]); entry.multiplier = atoi(row[8]); diff --git a/common/repositories/base/base_loottable_entries_repository.h b/common/repositories/base/base_loottable_entries_repository.h index d405b0894..f3baab03f 100644 --- a/common/repositories/base/base_loottable_entries_repository.h +++ b/common/repositories/base/base_loottable_entries_repository.h @@ -152,7 +152,7 @@ public: entry.multiplier = atoi(row[2]); entry.droplimit = atoi(row[3]); entry.mindrop = atoi(row[4]); - entry.probability = atof(row[5]); + entry.probability = static_cast(atof(row[5])); return entry; } @@ -288,7 +288,7 @@ public: entry.multiplier = atoi(row[2]); entry.droplimit = atoi(row[3]); entry.mindrop = atoi(row[4]); - entry.probability = atof(row[5]); + entry.probability = static_cast(atof(row[5])); all_entries.push_back(entry); } @@ -318,7 +318,7 @@ public: entry.multiplier = atoi(row[2]); entry.droplimit = atoi(row[3]); entry.mindrop = atoi(row[4]); - entry.probability = atof(row[5]); + entry.probability = static_cast(atof(row[5])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_npc_types_repository.h b/common/repositories/base/base_npc_types_repository.h index c85eba178..6ac6b5321 100644 --- a/common/repositories/base/base_npc_types_repository.h +++ b/common/repositories/base/base_npc_types_repository.h @@ -508,7 +508,7 @@ public: entry.texture = atoi(row[10]); entry.helmtexture = atoi(row[11]); entry.herosforgemodel = atoi(row[12]); - entry.size = atof(row[13]); + entry.size = static_cast(atof(row[13])); entry.hp_regen_rate = atoi(row[14]); entry.mana_regen_rate = atoi(row[15]); entry.loottable_id = atoi(row[16]); @@ -546,7 +546,7 @@ public: entry.prim_melee_type = atoi(row[48]); entry.sec_melee_type = atoi(row[49]); entry.ranged_type = atoi(row[50]); - entry.runspeed = atof(row[51]); + entry.runspeed = static_cast(atof(row[51])); entry.MR = atoi(row[52]); entry.CR = atoi(row[53]); entry.DR = atoi(row[54]); @@ -560,7 +560,7 @@ public: entry.AC = atoi(row[62]); entry.npc_aggro = atoi(row[63]); entry.spawn_limit = atoi(row[64]); - entry.attack_speed = atof(row[65]); + entry.attack_speed = static_cast(atof(row[65])); entry.attack_delay = atoi(row[66]); entry.findable = atoi(row[67]); entry.STR = atoi(row[68]); @@ -587,8 +587,8 @@ public: entry.underwater = atoi(row[89]); entry.isquest = atoi(row[90]); entry.emoteid = atoi(row[91]); - entry.spellscale = atof(row[92]); - entry.healscale = atof(row[93]); + entry.spellscale = static_cast(atof(row[92])); + entry.healscale = static_cast(atof(row[93])); entry.no_target_hotkey = atoi(row[94]); entry.raid_target = atoi(row[95]); entry.armtexture = atoi(row[96]); @@ -1105,7 +1105,7 @@ public: entry.texture = atoi(row[10]); entry.helmtexture = atoi(row[11]); entry.herosforgemodel = atoi(row[12]); - entry.size = atof(row[13]); + entry.size = static_cast(atof(row[13])); entry.hp_regen_rate = atoi(row[14]); entry.mana_regen_rate = atoi(row[15]); entry.loottable_id = atoi(row[16]); @@ -1143,7 +1143,7 @@ public: entry.prim_melee_type = atoi(row[48]); entry.sec_melee_type = atoi(row[49]); entry.ranged_type = atoi(row[50]); - entry.runspeed = atof(row[51]); + entry.runspeed = static_cast(atof(row[51])); entry.MR = atoi(row[52]); entry.CR = atoi(row[53]); entry.DR = atoi(row[54]); @@ -1157,7 +1157,7 @@ public: entry.AC = atoi(row[62]); entry.npc_aggro = atoi(row[63]); entry.spawn_limit = atoi(row[64]); - entry.attack_speed = atof(row[65]); + entry.attack_speed = static_cast(atof(row[65])); entry.attack_delay = atoi(row[66]); entry.findable = atoi(row[67]); entry.STR = atoi(row[68]); @@ -1184,8 +1184,8 @@ public: entry.underwater = atoi(row[89]); entry.isquest = atoi(row[90]); entry.emoteid = atoi(row[91]); - entry.spellscale = atof(row[92]); - entry.healscale = atof(row[93]); + entry.spellscale = static_cast(atof(row[92])); + entry.healscale = static_cast(atof(row[93])); entry.no_target_hotkey = atoi(row[94]); entry.raid_target = atoi(row[95]); entry.armtexture = atoi(row[96]); @@ -1251,7 +1251,7 @@ public: entry.texture = atoi(row[10]); entry.helmtexture = atoi(row[11]); entry.herosforgemodel = atoi(row[12]); - entry.size = atof(row[13]); + entry.size = static_cast(atof(row[13])); entry.hp_regen_rate = atoi(row[14]); entry.mana_regen_rate = atoi(row[15]); entry.loottable_id = atoi(row[16]); @@ -1289,7 +1289,7 @@ public: entry.prim_melee_type = atoi(row[48]); entry.sec_melee_type = atoi(row[49]); entry.ranged_type = atoi(row[50]); - entry.runspeed = atof(row[51]); + entry.runspeed = static_cast(atof(row[51])); entry.MR = atoi(row[52]); entry.CR = atoi(row[53]); entry.DR = atoi(row[54]); @@ -1303,7 +1303,7 @@ public: entry.AC = atoi(row[62]); entry.npc_aggro = atoi(row[63]); entry.spawn_limit = atoi(row[64]); - entry.attack_speed = atof(row[65]); + entry.attack_speed = static_cast(atof(row[65])); entry.attack_delay = atoi(row[66]); entry.findable = atoi(row[67]); entry.STR = atoi(row[68]); @@ -1330,8 +1330,8 @@ public: entry.underwater = atoi(row[89]); entry.isquest = atoi(row[90]); entry.emoteid = atoi(row[91]); - entry.spellscale = atof(row[92]); - entry.healscale = atof(row[93]); + entry.spellscale = static_cast(atof(row[92])); + entry.healscale = static_cast(atof(row[93])); entry.no_target_hotkey = atoi(row[94]); entry.raid_target = atoi(row[95]); entry.armtexture = atoi(row[96]); diff --git a/common/repositories/base/base_object_repository.h b/common/repositories/base/base_object_repository.h index e8f340f22..c44685202 100644 --- a/common/repositories/base/base_object_repository.h +++ b/common/repositories/base/base_object_repository.h @@ -210,10 +210,10 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.xpos = atof(row[3]); - entry.ypos = atof(row[4]); - entry.zpos = atof(row[5]); - entry.heading = atof(row[6]); + entry.xpos = static_cast(atof(row[3])); + entry.ypos = static_cast(atof(row[4])); + entry.zpos = static_cast(atof(row[5])); + entry.heading = static_cast(atof(row[6])); entry.itemid = atoi(row[7]); entry.charges = atoi(row[8]); entry.objectname = row[9] ? row[9] : ""; @@ -229,9 +229,9 @@ public: entry.unknown72 = atoi(row[19]); entry.unknown76 = atoi(row[20]); entry.unknown84 = atoi(row[21]); - entry.size = atof(row[22]); - entry.tilt_x = atof(row[23]); - entry.tilt_y = atof(row[24]); + entry.size = static_cast(atof(row[22])); + entry.tilt_x = static_cast(atof(row[23])); + entry.tilt_y = static_cast(atof(row[24])); entry.display_name = row[25] ? row[25] : ""; return entry; @@ -423,10 +423,10 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.xpos = atof(row[3]); - entry.ypos = atof(row[4]); - entry.zpos = atof(row[5]); - entry.heading = atof(row[6]); + entry.xpos = static_cast(atof(row[3])); + entry.ypos = static_cast(atof(row[4])); + entry.zpos = static_cast(atof(row[5])); + entry.heading = static_cast(atof(row[6])); entry.itemid = atoi(row[7]); entry.charges = atoi(row[8]); entry.objectname = row[9] ? row[9] : ""; @@ -442,9 +442,9 @@ public: entry.unknown72 = atoi(row[19]); entry.unknown76 = atoi(row[20]); entry.unknown84 = atoi(row[21]); - entry.size = atof(row[22]); - entry.tilt_x = atof(row[23]); - entry.tilt_y = atof(row[24]); + entry.size = static_cast(atof(row[22])); + entry.tilt_x = static_cast(atof(row[23])); + entry.tilt_y = static_cast(atof(row[24])); entry.display_name = row[25] ? row[25] : ""; all_entries.push_back(entry); @@ -473,10 +473,10 @@ public: entry.id = atoi(row[0]); entry.zoneid = atoi(row[1]); entry.version = atoi(row[2]); - entry.xpos = atof(row[3]); - entry.ypos = atof(row[4]); - entry.zpos = atof(row[5]); - entry.heading = atof(row[6]); + entry.xpos = static_cast(atof(row[3])); + entry.ypos = static_cast(atof(row[4])); + entry.zpos = static_cast(atof(row[5])); + entry.heading = static_cast(atof(row[6])); entry.itemid = atoi(row[7]); entry.charges = atoi(row[8]); entry.objectname = row[9] ? row[9] : ""; @@ -492,9 +492,9 @@ public: entry.unknown72 = atoi(row[19]); entry.unknown76 = atoi(row[20]); entry.unknown84 = atoi(row[21]); - entry.size = atof(row[22]); - entry.tilt_x = atof(row[23]); - entry.tilt_y = atof(row[24]); + entry.size = static_cast(atof(row[22])); + entry.tilt_x = static_cast(atof(row[23])); + entry.tilt_y = static_cast(atof(row[24])); entry.display_name = row[25] ? row[25] : ""; all_entries.push_back(entry); diff --git a/common/repositories/base/base_proximities_repository.h b/common/repositories/base/base_proximities_repository.h index bcb5522a5..502a822dc 100644 --- a/common/repositories/base/base_proximities_repository.h +++ b/common/repositories/base/base_proximities_repository.h @@ -155,12 +155,12 @@ public: entry.zoneid = atoi(row[0]); entry.exploreid = atoi(row[1]); - entry.minx = atof(row[2]); - entry.maxx = atof(row[3]); - entry.miny = atof(row[4]); - entry.maxy = atof(row[5]); - entry.minz = atof(row[6]); - entry.maxz = atof(row[7]); + entry.minx = static_cast(atof(row[2])); + entry.maxx = static_cast(atof(row[3])); + entry.miny = static_cast(atof(row[4])); + entry.maxy = static_cast(atof(row[5])); + entry.minz = static_cast(atof(row[6])); + entry.maxz = static_cast(atof(row[7])); return entry; } @@ -299,12 +299,12 @@ public: entry.zoneid = atoi(row[0]); entry.exploreid = atoi(row[1]); - entry.minx = atof(row[2]); - entry.maxx = atof(row[3]); - entry.miny = atof(row[4]); - entry.maxy = atof(row[5]); - entry.minz = atof(row[6]); - entry.maxz = atof(row[7]); + entry.minx = static_cast(atof(row[2])); + entry.maxx = static_cast(atof(row[3])); + entry.miny = static_cast(atof(row[4])); + entry.maxy = static_cast(atof(row[5])); + entry.minz = static_cast(atof(row[6])); + entry.maxz = static_cast(atof(row[7])); all_entries.push_back(entry); } @@ -331,12 +331,12 @@ public: entry.zoneid = atoi(row[0]); entry.exploreid = atoi(row[1]); - entry.minx = atof(row[2]); - entry.maxx = atof(row[3]); - entry.miny = atof(row[4]); - entry.maxy = atof(row[5]); - entry.minz = atof(row[6]); - entry.maxz = atof(row[7]); + entry.minx = static_cast(atof(row[2])); + entry.maxx = static_cast(atof(row[3])); + entry.miny = static_cast(atof(row[4])); + entry.maxy = static_cast(atof(row[5])); + entry.minz = static_cast(atof(row[6])); + entry.maxz = static_cast(atof(row[7])); all_entries.push_back(entry); } diff --git a/common/repositories/base/base_spawn2_repository.h b/common/repositories/base/base_spawn2_repository.h index ffff6b294..51e96a36b 100644 --- a/common/repositories/base/base_spawn2_repository.h +++ b/common/repositories/base/base_spawn2_repository.h @@ -178,10 +178,10 @@ public: entry.spawngroupID = atoi(row[1]); entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); entry.respawntime = atoi(row[8]); entry.variance = atoi(row[9]); entry.pathgrid = atoi(row[10]); @@ -347,10 +347,10 @@ public: entry.spawngroupID = atoi(row[1]); entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); entry.respawntime = atoi(row[8]); entry.variance = atoi(row[9]); entry.pathgrid = atoi(row[10]); @@ -386,10 +386,10 @@ public: entry.spawngroupID = atoi(row[1]); entry.zone = row[2] ? row[2] : ""; entry.version = atoi(row[3]); - entry.x = atof(row[4]); - entry.y = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); + entry.x = static_cast(atof(row[4])); + entry.y = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); entry.respawntime = atoi(row[8]); entry.variance = atoi(row[9]); entry.pathgrid = atoi(row[10]); diff --git a/common/repositories/base/base_spawngroup_repository.h b/common/repositories/base/base_spawngroup_repository.h index fceacd2b0..9e6e6bbf8 100644 --- a/common/repositories/base/base_spawngroup_repository.h +++ b/common/repositories/base/base_spawngroup_repository.h @@ -171,11 +171,11 @@ public: entry.id = atoi(row[0]); entry.name = row[1] ? row[1] : ""; entry.spawn_limit = atoi(row[2]); - entry.dist = atof(row[3]); - entry.max_x = atof(row[4]); - entry.min_x = atof(row[5]); - entry.max_y = atof(row[6]); - entry.min_y = atof(row[7]); + entry.dist = static_cast(atof(row[3])); + entry.max_x = static_cast(atof(row[4])); + entry.min_x = static_cast(atof(row[5])); + entry.max_y = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); entry.delay = atoi(row[8]); entry.mindelay = atoi(row[9]); entry.despawn = atoi(row[10]); @@ -332,11 +332,11 @@ public: entry.id = atoi(row[0]); entry.name = row[1] ? row[1] : ""; entry.spawn_limit = atoi(row[2]); - entry.dist = atof(row[3]); - entry.max_x = atof(row[4]); - entry.min_x = atof(row[5]); - entry.max_y = atof(row[6]); - entry.min_y = atof(row[7]); + entry.dist = static_cast(atof(row[3])); + entry.max_x = static_cast(atof(row[4])); + entry.min_x = static_cast(atof(row[5])); + entry.max_y = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); entry.delay = atoi(row[8]); entry.mindelay = atoi(row[9]); entry.despawn = atoi(row[10]); @@ -369,11 +369,11 @@ public: entry.id = atoi(row[0]); entry.name = row[1] ? row[1] : ""; entry.spawn_limit = atoi(row[2]); - entry.dist = atof(row[3]); - entry.max_x = atof(row[4]); - entry.min_x = atof(row[5]); - entry.max_y = atof(row[6]); - entry.min_y = atof(row[7]); + entry.dist = static_cast(atof(row[3])); + entry.max_x = static_cast(atof(row[4])); + entry.min_x = static_cast(atof(row[5])); + entry.max_y = static_cast(atof(row[6])); + entry.min_y = static_cast(atof(row[7])); entry.delay = atoi(row[8]); entry.mindelay = atoi(row[9]); entry.despawn = atoi(row[10]); diff --git a/common/repositories/base/base_spells_new_repository.h b/common/repositories/base/base_spells_new_repository.h index a38bdff4b..19220c09c 100644 --- a/common/repositories/base/base_spells_new_repository.h +++ b/common/repositories/base/base_spells_new_repository.h @@ -1067,10 +1067,10 @@ public: entry.persistdeath = atoi(row[224]); entry.field225 = atoi(row[225]); entry.field226 = atoi(row[226]); - entry.min_dist = atof(row[227]); - entry.min_dist_mod = atof(row[228]); - entry.max_dist = atof(row[229]); - entry.max_dist_mod = atof(row[230]); + entry.min_dist = static_cast(atof(row[227])); + entry.min_dist_mod = static_cast(atof(row[228])); + entry.max_dist = static_cast(atof(row[229])); + entry.max_dist_mod = static_cast(atof(row[230])); entry.min_range = atoi(row[231]); entry.field232 = atoi(row[232]); entry.field233 = atoi(row[233]); @@ -2127,10 +2127,10 @@ public: entry.persistdeath = atoi(row[224]); entry.field225 = atoi(row[225]); entry.field226 = atoi(row[226]); - entry.min_dist = atof(row[227]); - entry.min_dist_mod = atof(row[228]); - entry.max_dist = atof(row[229]); - entry.max_dist_mod = atof(row[230]); + entry.min_dist = static_cast(atof(row[227])); + entry.min_dist_mod = static_cast(atof(row[228])); + entry.max_dist = static_cast(atof(row[229])); + entry.max_dist_mod = static_cast(atof(row[230])); entry.min_range = atoi(row[231]); entry.field232 = atoi(row[232]); entry.field233 = atoi(row[233]); @@ -2388,10 +2388,10 @@ public: entry.persistdeath = atoi(row[224]); entry.field225 = atoi(row[225]); entry.field226 = atoi(row[226]); - entry.min_dist = atof(row[227]); - entry.min_dist_mod = atof(row[228]); - entry.max_dist = atof(row[229]); - entry.max_dist_mod = atof(row[230]); + entry.min_dist = static_cast(atof(row[227])); + entry.min_dist_mod = static_cast(atof(row[228])); + entry.max_dist = static_cast(atof(row[229])); + entry.max_dist_mod = static_cast(atof(row[230])); entry.min_range = atoi(row[231]); entry.field232 = atoi(row[232]); entry.field233 = atoi(row[233]); diff --git a/common/repositories/base/base_start_zones_repository.h b/common/repositories/base/base_start_zones_repository.h index 770c9f9fd..60cfd072a 100644 --- a/common/repositories/base/base_start_zones_repository.h +++ b/common/repositories/base/base_start_zones_repository.h @@ -183,10 +183,10 @@ public: if (results.RowCount() == 1) { StartZones entry{}; - entry.x = atof(row[0]); - entry.y = atof(row[1]); - entry.z = atof(row[2]); - entry.heading = atof(row[3]); + entry.x = static_cast(atof(row[0])); + entry.y = static_cast(atof(row[1])); + entry.z = static_cast(atof(row[2])); + entry.heading = static_cast(atof(row[3])); entry.zone_id = atoi(row[4]); entry.bind_id = atoi(row[5]); entry.player_choice = atoi(row[6]); @@ -194,9 +194,9 @@ public: entry.player_deity = atoi(row[8]); entry.player_race = atoi(row[9]); entry.start_zone = atoi(row[10]); - entry.bind_x = atof(row[11]); - entry.bind_y = atof(row[12]); - entry.bind_z = atof(row[13]); + entry.bind_x = static_cast(atof(row[11])); + entry.bind_y = static_cast(atof(row[12])); + entry.bind_z = static_cast(atof(row[13])); entry.select_rank = atoi(row[14]); entry.min_expansion = atoi(row[15]); entry.max_expansion = atoi(row[16]); @@ -367,10 +367,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartZones entry{}; - entry.x = atof(row[0]); - entry.y = atof(row[1]); - entry.z = atof(row[2]); - entry.heading = atof(row[3]); + entry.x = static_cast(atof(row[0])); + entry.y = static_cast(atof(row[1])); + entry.z = static_cast(atof(row[2])); + entry.heading = static_cast(atof(row[3])); entry.zone_id = atoi(row[4]); entry.bind_id = atoi(row[5]); entry.player_choice = atoi(row[6]); @@ -378,9 +378,9 @@ public: entry.player_deity = atoi(row[8]); entry.player_race = atoi(row[9]); entry.start_zone = atoi(row[10]); - entry.bind_x = atof(row[11]); - entry.bind_y = atof(row[12]); - entry.bind_z = atof(row[13]); + entry.bind_x = static_cast(atof(row[11])); + entry.bind_y = static_cast(atof(row[12])); + entry.bind_z = static_cast(atof(row[13])); entry.select_rank = atoi(row[14]); entry.min_expansion = atoi(row[15]); entry.max_expansion = atoi(row[16]); @@ -409,10 +409,10 @@ public: for (auto row = results.begin(); row != results.end(); ++row) { StartZones entry{}; - entry.x = atof(row[0]); - entry.y = atof(row[1]); - entry.z = atof(row[2]); - entry.heading = atof(row[3]); + entry.x = static_cast(atof(row[0])); + entry.y = static_cast(atof(row[1])); + entry.z = static_cast(atof(row[2])); + entry.heading = static_cast(atof(row[3])); entry.zone_id = atoi(row[4]); entry.bind_id = atoi(row[5]); entry.player_choice = atoi(row[6]); @@ -420,9 +420,9 @@ public: entry.player_deity = atoi(row[8]); entry.player_race = atoi(row[9]); entry.start_zone = atoi(row[10]); - entry.bind_x = atof(row[11]); - entry.bind_y = atof(row[12]); - entry.bind_z = atof(row[13]); + entry.bind_x = static_cast(atof(row[11])); + entry.bind_y = static_cast(atof(row[12])); + entry.bind_z = static_cast(atof(row[13])); entry.select_rank = atoi(row[14]); entry.min_expansion = atoi(row[15]); entry.max_expansion = atoi(row[16]); diff --git a/common/repositories/base/base_traps_repository.h b/common/repositories/base/base_traps_repository.h index ff1bc8474..213de6b6d 100644 --- a/common/repositories/base/base_traps_repository.h +++ b/common/repositories/base/base_traps_repository.h @@ -208,8 +208,8 @@ public: entry.y = atoi(row[4]); entry.z = atoi(row[5]); entry.chance = atoi(row[6]); - entry.maxzdiff = atof(row[7]); - entry.radius = atof(row[8]); + entry.maxzdiff = static_cast(atof(row[7])); + entry.radius = static_cast(atof(row[8])); entry.effect = atoi(row[9]); entry.effectvalue = atoi(row[10]); entry.effectvalue2 = atoi(row[11]); @@ -413,8 +413,8 @@ public: entry.y = atoi(row[4]); entry.z = atoi(row[5]); entry.chance = atoi(row[6]); - entry.maxzdiff = atof(row[7]); - entry.radius = atof(row[8]); + entry.maxzdiff = static_cast(atof(row[7])); + entry.radius = static_cast(atof(row[8])); entry.effect = atoi(row[9]); entry.effectvalue = atoi(row[10]); entry.effectvalue2 = atoi(row[11]); @@ -461,8 +461,8 @@ public: entry.y = atoi(row[4]); entry.z = atoi(row[5]); entry.chance = atoi(row[6]); - entry.maxzdiff = atof(row[7]); - entry.radius = atof(row[8]); + entry.maxzdiff = static_cast(atof(row[7])); + entry.radius = static_cast(atof(row[8])); entry.effect = atoi(row[9]); entry.effectvalue = atoi(row[10]); entry.effectvalue2 = atoi(row[11]); diff --git a/common/repositories/base/base_zone_points_repository.h b/common/repositories/base/base_zone_points_repository.h index 1b84254ab..8867e37d7 100644 --- a/common/repositories/base/base_zone_points_repository.h +++ b/common/repositories/base/base_zone_points_repository.h @@ -193,18 +193,18 @@ public: entry.zone = row[1] ? row[1] : ""; entry.version = atoi(row[2]); entry.number = atoi(row[3]); - entry.y = atof(row[4]); - entry.x = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); - entry.target_y = atof(row[8]); - entry.target_x = atof(row[9]); - entry.target_z = atof(row[10]); - entry.target_heading = atof(row[11]); + entry.y = static_cast(atof(row[4])); + entry.x = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); + entry.target_y = static_cast(atof(row[8])); + entry.target_x = static_cast(atof(row[9])); + entry.target_z = static_cast(atof(row[10])); + entry.target_heading = static_cast(atof(row[11])); entry.zoneinst = atoi(row[12]); entry.target_zone_id = atoi(row[13]); entry.target_instance = atoi(row[14]); - entry.buffer = atof(row[15]); + entry.buffer = static_cast(atof(row[15])); entry.client_version_mask = atoi(row[16]); entry.min_expansion = atoi(row[17]); entry.max_expansion = atoi(row[18]); @@ -382,18 +382,18 @@ public: entry.zone = row[1] ? row[1] : ""; entry.version = atoi(row[2]); entry.number = atoi(row[3]); - entry.y = atof(row[4]); - entry.x = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); - entry.target_y = atof(row[8]); - entry.target_x = atof(row[9]); - entry.target_z = atof(row[10]); - entry.target_heading = atof(row[11]); + entry.y = static_cast(atof(row[4])); + entry.x = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); + entry.target_y = static_cast(atof(row[8])); + entry.target_x = static_cast(atof(row[9])); + entry.target_z = static_cast(atof(row[10])); + entry.target_heading = static_cast(atof(row[11])); entry.zoneinst = atoi(row[12]); entry.target_zone_id = atoi(row[13]); entry.target_instance = atoi(row[14]); - entry.buffer = atof(row[15]); + entry.buffer = static_cast(atof(row[15])); entry.client_version_mask = atoi(row[16]); entry.min_expansion = atoi(row[17]); entry.max_expansion = atoi(row[18]); @@ -426,18 +426,18 @@ public: entry.zone = row[1] ? row[1] : ""; entry.version = atoi(row[2]); entry.number = atoi(row[3]); - entry.y = atof(row[4]); - entry.x = atof(row[5]); - entry.z = atof(row[6]); - entry.heading = atof(row[7]); - entry.target_y = atof(row[8]); - entry.target_x = atof(row[9]); - entry.target_z = atof(row[10]); - entry.target_heading = atof(row[11]); + entry.y = static_cast(atof(row[4])); + entry.x = static_cast(atof(row[5])); + entry.z = static_cast(atof(row[6])); + entry.heading = static_cast(atof(row[7])); + entry.target_y = static_cast(atof(row[8])); + entry.target_x = static_cast(atof(row[9])); + entry.target_z = static_cast(atof(row[10])); + entry.target_heading = static_cast(atof(row[11])); entry.zoneinst = atoi(row[12]); entry.target_zone_id = atoi(row[13]); entry.target_instance = atoi(row[14]); - entry.buffer = atof(row[15]); + entry.buffer = static_cast(atof(row[15])); entry.client_version_mask = atoi(row[16]); entry.min_expansion = atoi(row[17]); entry.max_expansion = atoi(row[18]); diff --git a/common/repositories/base/base_zone_repository.h b/common/repositories/base/base_zone_repository.h index 3729021f3..d436124ac 100644 --- a/common/repositories/base/base_zone_repository.h +++ b/common/repositories/base/base_zone_repository.h @@ -392,10 +392,10 @@ public: entry.file_name = row[2] ? row[2] : ""; entry.long_name = row[3] ? row[3] : ""; entry.map_file_name = row[4] ? row[4] : ""; - entry.safe_x = atof(row[5]); - entry.safe_y = atof(row[6]); - entry.safe_z = atof(row[7]); - entry.graveyard_id = atof(row[8]); + entry.safe_x = static_cast(atof(row[5])); + entry.safe_y = static_cast(atof(row[6])); + entry.safe_z = static_cast(atof(row[7])); + entry.graveyard_id = static_cast(atof(row[8])); entry.min_level = atoi(row[9]); entry.min_status = atoi(row[10]); entry.zoneidnumber = atoi(row[11]); @@ -404,40 +404,40 @@ public: entry.maxclients = atoi(row[14]); entry.ruleset = atoi(row[15]); entry.note = row[16] ? row[16] : ""; - entry.underworld = atof(row[17]); - entry.minclip = atof(row[18]); - entry.maxclip = atof(row[19]); - entry.fog_minclip = atof(row[20]); - entry.fog_maxclip = atof(row[21]); + entry.underworld = static_cast(atof(row[17])); + entry.minclip = static_cast(atof(row[18])); + entry.maxclip = static_cast(atof(row[19])); + entry.fog_minclip = static_cast(atof(row[20])); + entry.fog_maxclip = static_cast(atof(row[21])); entry.fog_blue = atoi(row[22]); entry.fog_red = atoi(row[23]); entry.fog_green = atoi(row[24]); entry.sky = atoi(row[25]); entry.ztype = atoi(row[26]); entry.zone_exp_multiplier = atof(row[27]); - entry.walkspeed = atof(row[28]); + entry.walkspeed = static_cast(atof(row[28])); entry.time_type = atoi(row[29]); entry.fog_red1 = atoi(row[30]); entry.fog_green1 = atoi(row[31]); entry.fog_blue1 = atoi(row[32]); - entry.fog_minclip1 = atof(row[33]); - entry.fog_maxclip1 = atof(row[34]); + entry.fog_minclip1 = static_cast(atof(row[33])); + entry.fog_maxclip1 = static_cast(atof(row[34])); entry.fog_red2 = atoi(row[35]); entry.fog_green2 = atoi(row[36]); entry.fog_blue2 = atoi(row[37]); - entry.fog_minclip2 = atof(row[38]); - entry.fog_maxclip2 = atof(row[39]); + entry.fog_minclip2 = static_cast(atof(row[38])); + entry.fog_maxclip2 = static_cast(atof(row[39])); entry.fog_red3 = atoi(row[40]); entry.fog_green3 = atoi(row[41]); entry.fog_blue3 = atoi(row[42]); - entry.fog_minclip3 = atof(row[43]); - entry.fog_maxclip3 = atof(row[44]); + entry.fog_minclip3 = static_cast(atof(row[43])); + entry.fog_maxclip3 = static_cast(atof(row[44])); entry.fog_red4 = atoi(row[45]); entry.fog_green4 = atoi(row[46]); entry.fog_blue4 = atoi(row[47]); - entry.fog_minclip4 = atof(row[48]); - entry.fog_maxclip4 = atof(row[49]); - entry.fog_density = atof(row[50]); + entry.fog_minclip4 = static_cast(atof(row[48])); + entry.fog_maxclip4 = static_cast(atof(row[49])); + entry.fog_density = static_cast(atof(row[50])); entry.flag_needed = row[51] ? row[51] : ""; entry.canbind = atoi(row[52]); entry.cancombat = atoi(row[53]); @@ -465,7 +465,7 @@ public: entry.snow_duration2 = atoi(row[75]); entry.snow_duration3 = atoi(row[76]); entry.snow_duration4 = atoi(row[77]); - entry.gravity = atof(row[78]); + entry.gravity = static_cast(atof(row[78])); entry.type = atoi(row[79]); entry.skylock = atoi(row[80]); entry.fast_regen_hp = atoi(row[81]); @@ -845,10 +845,10 @@ public: entry.file_name = row[2] ? row[2] : ""; entry.long_name = row[3] ? row[3] : ""; entry.map_file_name = row[4] ? row[4] : ""; - entry.safe_x = atof(row[5]); - entry.safe_y = atof(row[6]); - entry.safe_z = atof(row[7]); - entry.graveyard_id = atof(row[8]); + entry.safe_x = static_cast(atof(row[5])); + entry.safe_y = static_cast(atof(row[6])); + entry.safe_z = static_cast(atof(row[7])); + entry.graveyard_id = static_cast(atof(row[8])); entry.min_level = atoi(row[9]); entry.min_status = atoi(row[10]); entry.zoneidnumber = atoi(row[11]); @@ -857,40 +857,40 @@ public: entry.maxclients = atoi(row[14]); entry.ruleset = atoi(row[15]); entry.note = row[16] ? row[16] : ""; - entry.underworld = atof(row[17]); - entry.minclip = atof(row[18]); - entry.maxclip = atof(row[19]); - entry.fog_minclip = atof(row[20]); - entry.fog_maxclip = atof(row[21]); + entry.underworld = static_cast(atof(row[17])); + entry.minclip = static_cast(atof(row[18])); + entry.maxclip = static_cast(atof(row[19])); + entry.fog_minclip = static_cast(atof(row[20])); + entry.fog_maxclip = static_cast(atof(row[21])); entry.fog_blue = atoi(row[22]); entry.fog_red = atoi(row[23]); entry.fog_green = atoi(row[24]); entry.sky = atoi(row[25]); entry.ztype = atoi(row[26]); entry.zone_exp_multiplier = atof(row[27]); - entry.walkspeed = atof(row[28]); + entry.walkspeed = static_cast(atof(row[28])); entry.time_type = atoi(row[29]); entry.fog_red1 = atoi(row[30]); entry.fog_green1 = atoi(row[31]); entry.fog_blue1 = atoi(row[32]); - entry.fog_minclip1 = atof(row[33]); - entry.fog_maxclip1 = atof(row[34]); + entry.fog_minclip1 = static_cast(atof(row[33])); + entry.fog_maxclip1 = static_cast(atof(row[34])); entry.fog_red2 = atoi(row[35]); entry.fog_green2 = atoi(row[36]); entry.fog_blue2 = atoi(row[37]); - entry.fog_minclip2 = atof(row[38]); - entry.fog_maxclip2 = atof(row[39]); + entry.fog_minclip2 = static_cast(atof(row[38])); + entry.fog_maxclip2 = static_cast(atof(row[39])); entry.fog_red3 = atoi(row[40]); entry.fog_green3 = atoi(row[41]); entry.fog_blue3 = atoi(row[42]); - entry.fog_minclip3 = atof(row[43]); - entry.fog_maxclip3 = atof(row[44]); + entry.fog_minclip3 = static_cast(atof(row[43])); + entry.fog_maxclip3 = static_cast(atof(row[44])); entry.fog_red4 = atoi(row[45]); entry.fog_green4 = atoi(row[46]); entry.fog_blue4 = atoi(row[47]); - entry.fog_minclip4 = atof(row[48]); - entry.fog_maxclip4 = atof(row[49]); - entry.fog_density = atof(row[50]); + entry.fog_minclip4 = static_cast(atof(row[48])); + entry.fog_maxclip4 = static_cast(atof(row[49])); + entry.fog_density = static_cast(atof(row[50])); entry.flag_needed = row[51] ? row[51] : ""; entry.canbind = atoi(row[52]); entry.cancombat = atoi(row[53]); @@ -918,7 +918,7 @@ public: entry.snow_duration2 = atoi(row[75]); entry.snow_duration3 = atoi(row[76]); entry.snow_duration4 = atoi(row[77]); - entry.gravity = atof(row[78]); + entry.gravity = static_cast(atof(row[78])); entry.type = atoi(row[79]); entry.skylock = atoi(row[80]); entry.fast_regen_hp = atoi(row[81]); @@ -955,10 +955,10 @@ public: entry.file_name = row[2] ? row[2] : ""; entry.long_name = row[3] ? row[3] : ""; entry.map_file_name = row[4] ? row[4] : ""; - entry.safe_x = atof(row[5]); - entry.safe_y = atof(row[6]); - entry.safe_z = atof(row[7]); - entry.graveyard_id = atof(row[8]); + entry.safe_x = static_cast(atof(row[5])); + entry.safe_y = static_cast(atof(row[6])); + entry.safe_z = static_cast(atof(row[7])); + entry.graveyard_id = static_cast(atof(row[8])); entry.min_level = atoi(row[9]); entry.min_status = atoi(row[10]); entry.zoneidnumber = atoi(row[11]); @@ -967,40 +967,40 @@ public: entry.maxclients = atoi(row[14]); entry.ruleset = atoi(row[15]); entry.note = row[16] ? row[16] : ""; - entry.underworld = atof(row[17]); - entry.minclip = atof(row[18]); - entry.maxclip = atof(row[19]); - entry.fog_minclip = atof(row[20]); - entry.fog_maxclip = atof(row[21]); + entry.underworld = static_cast(atof(row[17])); + entry.minclip = static_cast(atof(row[18])); + entry.maxclip = static_cast(atof(row[19])); + entry.fog_minclip = static_cast(atof(row[20])); + entry.fog_maxclip = static_cast(atof(row[21])); entry.fog_blue = atoi(row[22]); entry.fog_red = atoi(row[23]); entry.fog_green = atoi(row[24]); entry.sky = atoi(row[25]); entry.ztype = atoi(row[26]); entry.zone_exp_multiplier = atof(row[27]); - entry.walkspeed = atof(row[28]); + entry.walkspeed = static_cast(atof(row[28])); entry.time_type = atoi(row[29]); entry.fog_red1 = atoi(row[30]); entry.fog_green1 = atoi(row[31]); entry.fog_blue1 = atoi(row[32]); - entry.fog_minclip1 = atof(row[33]); - entry.fog_maxclip1 = atof(row[34]); + entry.fog_minclip1 = static_cast(atof(row[33])); + entry.fog_maxclip1 = static_cast(atof(row[34])); entry.fog_red2 = atoi(row[35]); entry.fog_green2 = atoi(row[36]); entry.fog_blue2 = atoi(row[37]); - entry.fog_minclip2 = atof(row[38]); - entry.fog_maxclip2 = atof(row[39]); + entry.fog_minclip2 = static_cast(atof(row[38])); + entry.fog_maxclip2 = static_cast(atof(row[39])); entry.fog_red3 = atoi(row[40]); entry.fog_green3 = atoi(row[41]); entry.fog_blue3 = atoi(row[42]); - entry.fog_minclip3 = atof(row[43]); - entry.fog_maxclip3 = atof(row[44]); + entry.fog_minclip3 = static_cast(atof(row[43])); + entry.fog_maxclip3 = static_cast(atof(row[44])); entry.fog_red4 = atoi(row[45]); entry.fog_green4 = atoi(row[46]); entry.fog_blue4 = atoi(row[47]); - entry.fog_minclip4 = atof(row[48]); - entry.fog_maxclip4 = atof(row[49]); - entry.fog_density = atof(row[50]); + entry.fog_minclip4 = static_cast(atof(row[48])); + entry.fog_maxclip4 = static_cast(atof(row[49])); + entry.fog_density = static_cast(atof(row[50])); entry.flag_needed = row[51] ? row[51] : ""; entry.canbind = atoi(row[52]); entry.cancombat = atoi(row[53]); @@ -1028,7 +1028,7 @@ public: entry.snow_duration2 = atoi(row[75]); entry.snow_duration3 = atoi(row[76]); entry.snow_duration4 = atoi(row[77]); - entry.gravity = atof(row[78]); + entry.gravity = static_cast(atof(row[78])); entry.type = atoi(row[79]); entry.skylock = atoi(row[80]); entry.fast_regen_hp = atoi(row[81]); diff --git a/utils/scripts/generators/repository-generator.pl b/utils/scripts/generators/repository-generator.pl index 93084d7a0..0efcd25b9 100644 --- a/utils/scripts/generators/repository-generator.pl +++ b/utils/scripts/generators/repository-generator.pl @@ -17,6 +17,11 @@ use DBD::mysql; use JSON; my $json = new JSON(); +if (!$ARGV[0]) { + print "\@example perl ~/code/utils/scripts/generators/repository-generator.pl ~/server/ [table|all] [base|extended|all]\n"; + exit; +} + ############################################# # args ############################################# @@ -277,7 +282,11 @@ foreach my $table_to_generate (@tables) { $all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name, $index); $find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name, $index); } - elsif ($data_type =~ /float|double|decimal/) { + elsif ($data_type =~ /float/) { + $all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = static_cast(atof(row[%s]));\n", $column_name, $index); + $find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = static_cast(atof(row[%s]));\n", $column_name, $index); + } + elsif ($data_type =~ /double|decimal/) { $all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atof(row[%s]);\n", $column_name, $index); $find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atof(row[%s]);\n", $column_name, $index); }