From c228604255df5821049d8ea43394329bd9a3ede5 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:27:59 -0500 Subject: [PATCH] [Bug Fix] Fix Beastlord Warder Size Modifier (#4665) * [Bug Fix] Fix Beastlord Warder Size Modifier * Push * Update repository-generator.pl --------- Co-authored-by: Chris Miles --- .../repositories/base/base_pets_beastlord_data_repository.h | 3 +++ utils/scripts/generators/repository-generator.pl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/common/repositories/base/base_pets_beastlord_data_repository.h b/common/repositories/base/base_pets_beastlord_data_repository.h index 1ae32f793..9960a8c36 100644 --- a/common/repositories/base/base_pets_beastlord_data_repository.h +++ b/common/repositories/base/base_pets_beastlord_data_repository.h @@ -144,6 +144,7 @@ public: e.texture = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; e.helm_texture = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; e.gender = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 2; + e.size_modifier = row[5] ? (strtof(row[5], nullptr) > 0.0f ? strtof(row[5], nullptr) : 1) : 1; e.face = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; return e; @@ -287,6 +288,7 @@ public: e.texture = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; e.helm_texture = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; e.gender = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 2; + e.size_modifier = row[5] ? (strtof(row[5], nullptr) > 0.0f ? strtof(row[5], nullptr) : 1) : 1; e.face = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; all_entries.push_back(e); @@ -317,6 +319,7 @@ public: e.texture = row[2] ? static_cast(strtoul(row[2], nullptr, 10)) : 0; e.helm_texture = row[3] ? static_cast(strtoul(row[3], nullptr, 10)) : 0; e.gender = row[4] ? static_cast(strtoul(row[4], nullptr, 10)) : 2; + e.size_modifier = row[5] ? (strtof(row[5], nullptr) > 0.0f ? strtof(row[5], nullptr) : 1) : 1; e.face = row[6] ? static_cast(strtoul(row[6], nullptr, 10)) : 0; all_entries.push_back(e); diff --git a/utils/scripts/generators/repository-generator.pl b/utils/scripts/generators/repository-generator.pl index 396b1e875..6cb6a137c 100644 --- a/utils/scripts/generators/repository-generator.pl +++ b/utils/scripts/generators/repository-generator.pl @@ -335,6 +335,10 @@ foreach my $table_to_generate (@tables) { $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? static_cast<%s>(strtoul(row[%s], nullptr, 10)) : %s;\n", $column_name_formatted, $index, $struct_data_type, $index, $default_value); $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? static_cast<%s>(strtoul(row[%s], nullptr, 10)) : %s;\n", $column_name_formatted, $index, $struct_data_type, $index, $default_value); } + elsif ($data_type =~ /float|decimal/) { + $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? (strtof(row[%s], nullptr) > 0.0f ? strtof(row[%s], nullptr) : %s) : %s;\n", $column_name_formatted, $index, $index, $index, $default_value, $default_value); + $find_one_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? (strtof(row[%s], nullptr) > 0.0f ? strtof(row[%s], nullptr) : %s) : %s;\n", $column_name_formatted, $index, $index, $index, $default_value, $default_value); + } } elsif ($data_type =~ /bigint/) { $all_entries .= sprintf("\t\t\te.%-${longest_column_length}s = row[%s] ? strtoll(row[%s], nullptr, 10) : %s;\n", $column_name_formatted, $index, $index, $default_value);