General fixes

+Fixed a bug that didn't permit to display the bonus of some buildings
at level 0
+The cavalry training percentage bonus, provided by the horsedrinking
trough, is now displayed correctly
This commit is contained in:
iopietro
2018-05-18 17:23:54 +02:00
parent 0322a0ae49
commit b91e27381b
16 changed files with 56 additions and 33 deletions
+1 -1
View File
@@ -464,7 +464,7 @@ class Battle {
$winner = ($rap > $rdp);
// Formula for calculating the Moral
// WW villages aren't affected by this moral bonus
// WW villages aren't affected by this bonus
if($attpop > $defpop && !$isWWVillage) {
$moralbonus = 1 / round(max(0.667, pow($defpop / $attpop, 0.2 * min(1, $rap / ($rdp > 0 ? $rdp : 1)))), 3);
}