Merge branch 'release-0.4.1' into develop
This commit is contained in:
commit
80f7cd1dfe
1 file changed
+24
-3
@@ -20,6 +20,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using VocaluxeLib.Game;
|
||||
using VocaluxeLib.Menu;
|
||||
using VocaluxeLib.Songs;
|
||||
|
||||
@@ -534,13 +535,33 @@ namespace VocaluxeLib.PartyModes.TicTacToe
|
||||
if (!GameData.Rounds[GameData.FieldNr].Finished)
|
||||
GameData.CurrentRoundNr++;
|
||||
|
||||
CPoints points = CBase.Game.GetPoints();
|
||||
SPlayer[] results = CBase.Game.GetPlayers();
|
||||
if (results == null)
|
||||
|
||||
if (results == null || results.Length < 2)
|
||||
return;
|
||||
|
||||
if (results.Length < 2)
|
||||
return;
|
||||
//Sum up all points
|
||||
for (int r = 0; r < points.NumRounds; r++)
|
||||
{
|
||||
SPlayer[] player = points.GetPlayer(r, 2);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
results[i].Points += player[i].Points;
|
||||
results[i].PointsGoldenNotes += player[i].PointsGoldenNotes;
|
||||
results[i].PointsLineBonus += player[i].PointsLineBonus;
|
||||
}
|
||||
}
|
||||
|
||||
//Calc average of points
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
results[i].Points /= points.NumRounds;
|
||||
results[i].PointsGoldenNotes /= points.NumRounds;
|
||||
results[i].PointsLineBonus /= points.NumRounds;
|
||||
}
|
||||
|
||||
//Decide who has won
|
||||
GameData.Rounds[GameData.FieldNr].PointsTeam1 = (int)Math.Round(results[0].Points);
|
||||
GameData.Rounds[GameData.FieldNr].PointsTeam2 = (int)Math.Round(results[1].Points);
|
||||
GameData.Rounds[GameData.FieldNr].Finished = true;
|
||||
|
||||
Reference in new issue
Block a user