Possibility added to switch between old RASP-karma and new percentage
This commit is contained in:
committed by
Steffen Schröder
parent
904f000481
commit
919c5b4270
@ -343,21 +343,26 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
|
||||
$mapList = array();
|
||||
foreach($maps as $map) {
|
||||
if($map instanceof Map) {
|
||||
$votes = $karmaPlugin->getMapVotes($map);
|
||||
$min = 0;
|
||||
$plus = 0;
|
||||
foreach($votes as $vote) {
|
||||
if(isset($vote->vote)) {
|
||||
if($vote->vote != 0.5) {
|
||||
if($vote->vote < 0.5) {
|
||||
$min = $min+$vote->count;
|
||||
} else {
|
||||
$plus = $plus+$vote->count;
|
||||
if($this->maniaControl->settingManager->getSetting($karmaPlugin, $karmaPlugin::SETTING_NEWKARMA) === true) {
|
||||
$karma = $karmaPlugin->getMapKarma($map);
|
||||
$map->karma = round($karma * 100.);
|
||||
} else {
|
||||
$votes = $karmaPlugin->getMapVotes($map);
|
||||
$min = 0;
|
||||
$plus = 0;
|
||||
foreach($votes as $vote) {
|
||||
if(isset($vote->vote)) {
|
||||
if($vote->vote != 0.5) {
|
||||
if($vote->vote < 0.5) {
|
||||
$min = $min+$vote->count;
|
||||
} else {
|
||||
$plus = $plus+$vote->count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$map->karma = $plus-$min;
|
||||
}
|
||||
$map->karma = $plus-$min;
|
||||
$mapList[] = $map;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user