명성 / 계급 계산식을 for loop 없앰
This commit is contained in:
@@ -445,18 +445,14 @@ function getExpLevel($experience) {
|
|||||||
if($experience < 1000) {
|
if($experience < 1000) {
|
||||||
$level = intdiv($experience, 100);
|
$level = intdiv($experience, 100);
|
||||||
} else {
|
} else {
|
||||||
for($level = 0; $experience > (($level+1)*($level+1)*10); $level++) {
|
$level = Util::toInt(sqrt($experience/10));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $level;
|
return $level;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDedLevel($dedication) {
|
function getDedLevel($dedication) {
|
||||||
for($level = 0; $dedication > (($level+1)*($level+1)*100); $level++) {
|
return Util::toInt(sqrt($dedication/100));
|
||||||
}
|
|
||||||
|
|
||||||
return $level;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function expStatus($exp) {
|
function expStatus($exp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user