From 5d60d0893e283cd287ffc588774cbf8d995e19f3 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Tue, 12 Jun 2007 16:55:47 +0000 Subject: Fixed a Bug in Database System thx to Pr3D@ToR git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@260 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UDataBase.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code') diff --git a/Game/Code/Classes/UDataBase.pas b/Game/Code/Classes/UDataBase.pas index 0e5a4a3f..b8b41bc1 100644 --- a/Game/Code/Classes/UDataBase.pas +++ b/Game/Code/Classes/UDataBase.pas @@ -209,7 +209,7 @@ begin //Create Query Case Typ of 0: Query := 'SELECT `Player` , `Difficulty` , `Score` , `Artist` , `Title` FROM `US_Scores` INNER JOIN `US_Songs` ON (`SongID` = `ID`) ORDER BY `Score`'; - 1: Query := 'SELECT `Player` , (Sum(`Score`) / COUNT(`Score`)) FROM `US_Scores` GROUP BY `Player` ORDER BY (Sum(`Score`) / COUNT(`Score`))'; + 1: Query := 'SELECT `Player` , ROUND (Sum(`Score`) / COUNT(`Score`)) FROM `US_Scores` GROUP BY `Player` ORDER BY (Sum(`Score`) / COUNT(`Score`))'; 2: Query := 'SELECT `Artist` , `Title` , `TimesPlayed` FROM `US_Songs` ORDER BY `TimesPlayed`'; 3: Query := 'SELECT `Artist` , Sum(`TimesPlayed`) FROM `US_Songs` GROUP BY `Artist` ORDER BY Sum(`TimesPlayed`)'; end; @@ -252,7 +252,7 @@ begin 1:begin Stats[TableData.Row].Player := TableData.Fields[0]; - Stats[TableData.Row].AverageScore := TableData.FieldAsInteger(1); + Stats[TableData.Row].AverageScore := StrtoIntDef(TableData.Fields[1], 0); end; 2:begin -- cgit v1.2.3