mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-26 14:36:06 +00:00
division by zero error fix
This commit is contained in:
@@ -372,8 +372,12 @@ class Battle {
|
||||
$moralbonus = min(1.5, pow($attpop / $defpop, (0.2*($rap/$rdp))));
|
||||
}
|
||||
else {
|
||||
if($defpop==0){
|
||||
$moralbonus = min(1.5, pow($attpop, 0.2));
|
||||
}else{
|
||||
$moralbonus = min(1.5, pow($attpop / $defpop, 0.2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$moralbonus = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user