mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fixed some bugs
+Fixed a "division by zero" error, in Battle.php +Reworked spied informations, now they're shown only if the building is at least at level 1. Splitted residence/palace information in two distinct informations. Now the total crannies capacity is displayed (even if the capacity is 0) instead of the level of the greatest cranny +Fixed "getFieldLevelInVillage" function in Database.php -Removed an useless control in Units.php
This commit is contained in:
@@ -524,7 +524,7 @@ class Battle {
|
||||
|
||||
// Formula for calculating the Moral
|
||||
if($attpop > $defpop) {
|
||||
$moralbonus = 1 / round(max(0.667, pow($defpop / $attpop, 0.2 * min(1, $rap / $rdp))), 3);
|
||||
$moralbonus = 1 / round(max(0.667, pow($defpop / $attpop, 0.2 * min(1, $rap / ($rdp > 0 ? $rdp : 1)))), 3);
|
||||
}else{
|
||||
$moralbonus = 1.0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user