Commits

David Stone  committed 8a9bea6

Fixed statistics loading code to not assume that all Pokemon show up in the settings files.

  • Participants
  • Parent commits 13dbd5a

Comments (0)

Files changed (2)

File source/team_predictor/detailed_stats.cpp

 
 namespace technicalmachine {
 
-DetailedStats::DetailedStats() {
+DetailedStats::DetailedStats():
+	ability(),
+	item(),
+	nature()
+	{
 	static std::string const file_name = "settings/Generation 4/OU/detailed.txt";
 	std::ifstream file(file_name);
 	if (!file.is_open()) {

File source/team_predictor/load_stats.cpp

 
 template<typename T>
 std::array<T, number_of_species> load_stats_from_file (std::string const & file_name) {
-	std::array<T, number_of_species> overall;
+	std::array<T, number_of_species> overall {{ 0 }};
 	std::ifstream file(file_name);
 	if (!file.is_open()) {
 		throw InvalidSettingsFile(file_name, InvalidSettingsFile::does_not_exist);