From 3bdd5835d3d92f871d76c7b8e7009742fefd5231 Mon Sep 17 00:00:00 2001 From: Squigs44 <96dwilliams@gmail.com> Date: Thu, 25 Jun 2020 18:05:47 -0600 Subject: [PATCH] small change on gr initialization --- ghostratings/calculations.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ghostratings/calculations.php b/ghostratings/calculations.php index d3479b54d..ab05aaa14 100644 --- a/ghostratings/calculations.php +++ b/ghostratings/calculations.php @@ -60,7 +60,14 @@ public function __construct($gameID, $SCcounts, $memberStatus, $variantID, $pres $this->gameTurns = $gameTurns; $this->gameStatus = $gameStatus; $this->phaseMinutes = $phaseMinutes; - $this->variantMod = Config::$grVariantMods[$this->variantID]; + if (isset(Config::$grVariantMods[$this->variantID])) + { + $this->variantMod = Config::$grVariantMods[$this->variantID]; + } + else + { + $this->variantMod = 1; + } $this->victorySC = $victorySC; $this->variantSC = $variantSC; $this->winner = $winner; @@ -68,7 +75,14 @@ public function __construct($gameID, $SCcounts, $memberStatus, $variantID, $pres $this->time = $time; $this->k = 32; //A higher k value means players will move faster up and down in rankings. $this->start = 100; //32 and 100 are arbitrary numbers used for scaling in 1v1 rankings. - $this->pressMod = Config::$grPressMods[$this->pressType]; + if (isset(Config::$grPressMods[$this->pressType])) + { + $this->pressMod = Config::$grPressMods[$this->pressType]; + } + else + { + $this->pressMod = 1; + } $this->modvalue = (17.5 * $this->variantMod * $this->pressMod); //17.5 is the 'k' value for non 1v1 games and is used for scaling. }