aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-12 16:55:47 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-06-12 16:55:47 +0000
commit5d60d0893e283cd287ffc588774cbf8d995e19f3 (patch)
tree2c6efbdbde994eaad1f478830304f30d707a162a
parent2473c6ee14684926ef7b61d1691946b852ebef05 (diff)
downloadusdx-5d60d0893e283cd287ffc588774cbf8d995e19f3.tar.gz
usdx-5d60d0893e283cd287ffc588774cbf8d995e19f3.tar.xz
usdx-5d60d0893e283cd287ffc588774cbf8d995e19f3.zip
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
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UDataBase.pas4
1 files changed, 2 insertions, 2 deletions
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