Exp isn't checked if it's zero and we all know what happens when you try to divide by 0...
Here is the manual fix
Or you can download the patched files
[1.7.1] exp 'Division by zero' error
NOTE: The Download includes the [1.7.1] Riding Skill Errors fix
memberslist.php
Find around line 696
- Code: Select all
$percent_exp = round(($current/$max)*100);
Replace with
- Code: Select all
$percent_exp = ($max > 0 ? round(($current/$max)*100) : 0);
lib/char.php
Find around lines 45-57
(entire function)
- Code: Select all
function printXP()
{
list($current, $max) =
explode( ':', $this->data['exp'] );
$perc='';
if ($current > 0)
{
$perc = round(($current / $max)* 248, 1);
}
return $perc;
}
Replace with
- Code: Select all
function printXP()
{
list($current, $max) = explode( ':', $this->data['exp'] );
$perc = 0;
if( $max > 0 )
{
$perc = round(($current / $max)* 248, 0);
}
return $perc;
}
Find around lines 1493-1505
- Code: Select all
$expbar_width = $this->printXP();
list($xp, $xplevel, $xprest) = explode(':',$this->data['exp']);
if ($xplevel != '0' || $xplevel != '')
{
if( $xprest > 0 )
{
$expbar_text = $xp.'/'.$xplevel.' : '.$xprest.' ('.round($xp/$xplevel*100).'%)';
}
else
{
$expbar_text = $xp.'/'.$xplevel.' ('.round($xp/$xplevel*100).'%)';
}
}
Replace with
- Code: Select all
$expbar_width = $this->printXP();
list($xp, $xplevel, $xprest) = explode(':',$this->data['exp']);
if ($xplevel != '0' && $xplevel != '')
{
$exp_percent = ( $xplevel > 0 ? round(($xp/$xplevel)*100) : 0);
if( $xprest > 0 )
{
$expbar_text = $xp.'/'.$xplevel.' : '.$xprest.' ('.$exp_percent.'%)';
}
else
{
$expbar_text = $xp.'/'.$xplevel.' ('.$exp_percent.'%)';
}
}