Hi,
I have problem with stat. Stat wrong update point.
I have 2moons 1.7.3
I search fix on github but I need your help.
My class.statbuilder.php
Error on tech and on buildings
Help me fix this
Display All
I have problem with stat. Stat wrong update point.
I have 2moons 1.7.3
I search fix on github but I need your help.
My class.statbuilder.php
Error on tech and on buildings
Help me fix this
Source Code
- private function GetTechnoPoints($USER)
- {
- global $resource, $reslist, $pricelist;
- $TechCounts = 0;
- $TechPoints = 0;
- foreach($reslist['tech'] as $Techno)
- {
- if($USER[$resource[$Techno]] == 0) continue;
- $Units = $pricelist[$Techno]['cost'][901] + $pricelist[$Techno]['cost'][902] + $pricelist[$Techno]['cost'][903];
- for($Level = 1; $Level < $USER[$resource[$Techno]]; $Level++)
- {
- $TechPoints += $Units * pow($pricelist[$Techno]['factor'], $Level);
- }
- $TechCounts += $USER[$resource[$Techno]];
- $this->setRecords($USER['id'], $Techno, $USER[$resource[$Techno]]);
- }
- return array('count' => $TechCounts, 'points' => ($TechPoints / Config::get('stat_settings')));
- }
- private function GetBuildPoints($PLANET)
- {
- global $resource, $reslist, $pricelist;
- $BuildCounts = 0;
- $BuildPoints = 0;
- foreach($reslist['build'] as $Build)
- {
- if($PLANET[$resource[$Build]] == 0) continue;
- $Units = $pricelist[$Build]['cost'][901] + $pricelist[$Build]['cost'][902] + $pricelist[$Build]['cost'][903];
- for($Level = 1; $Level <= $PLANET[$resource[$Build]]; $Level++)
- {
- $BuildPoints += $Units * pow($pricelist[$Build]['factor'], $Level);
- }
- $BuildCounts += $PLANET[$resource[$Build]];
- $this->setRecords($PLANET['id_owner'], $Build, $PLANET[$resource[$Build]]);
- }
- return array('count' => $BuildCounts, 'points' => ($BuildPoints / Config::get('stat_settings')));
- }