Correction du classement #13

Merged
nemunaire merged 4 commits from fix/classement into master 2021-01-01 20:07:03 +00:00
Showing only changes of commit afa97638fa - Show all commits

View File

@ -113,6 +113,7 @@ class User
public function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false) public function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
{ {
/* Ancien code, fait des calculs boursier dans le système de points, wtf ?
global $table_bourse_ressources; global $table_bourse_ressources;
//On charge les 3 valeurs boursières //On charge les 3 valeurs boursières
$bdd = new BDD(); $bdd = new BDD();
@ -129,6 +130,11 @@ class User
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal); $points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal); $points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene); $points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
*/
$rate = 0.7;
$points = $metal *$rate;
$points += $cristal *$rate;
$points += $hydrogene *$rate;
if ($demolition) { if ($demolition) {
$this->points -= intval($points); $this->points -= intval($points);