fix: this can sometimes go above current building level

This commit is contained in:
Martin Ambrus
2017-11-13 17:19:18 +01:00
parent 35512d16f0
commit c6d9d264ce
+1 -1
View File
@@ -1113,7 +1113,7 @@ class Automation {
$totallvl = round( sqrt( pow( ( $tblevel + 0.5 ), 2 ) - ( ( !$twoRowsCatapultSetup ? (int) $battlepart[4] : (int) $battlepart[4] / 2 ) * 8 ) ) ); $totallvl = round( sqrt( pow( ( $tblevel + 0.5 ), 2 ) - ( ( !$twoRowsCatapultSetup ? (int) $battlepart[4] : (int) $battlepart[4] / 2 ) * 8 ) ) );
// no damage to the building/field // no damage to the building/field
if ( $tblevel == $totallvl ) { if ( $tblevel >= $totallvl ) {
$info_cata = " was not damaged."; $info_cata = " was not damaged.";
} else // building/field damaged, damage calculations to follow } else // building/field damaged, damage calculations to follow
{ {