Fixed a bug while chiefing and catapulting

+Brewery, big parties and moral bonus are now counted correctly towards
the loyalty reduction
+If you have a brewery you'll now forced to attack random buildings
+Some clean-up
This commit is contained in:
iopietro
2018-05-01 17:03:41 +02:00
parent 2fc3e7b7da
commit 0a9fe1125e
4 changed files with 201 additions and 221 deletions
+14 -6
View File
@@ -394,20 +394,28 @@ class Units {
}
if(isset($post['ctar1'])) {
if($rivalsGreatConfusion['totals'] > 0) {
if($post['ctar1'] != 40 && ($post['ctar1'] != 27 || ($post['ctar1'] == 27 && $rivalsGreatConfusion['unique'] > 0))) {
$post['ctar1'] = 0;
//Is the Brewery built?
if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){
if($rivalsGreatConfusion['totals'] > 0) {
if($post['ctar1'] != 40 && ($post['ctar1'] != 27 || ($post['ctar1'] == 27 && $rivalsGreatConfusion['unique'] > 0))) {
$post['ctar1'] = 0;
}
}
}
else $post['ctar1'] = 0;
}
else $post['ctar1'] = 0;
if(isset($post['ctar2']) && $post['ctar2'] > 0) {
if($rivalsGreatConfusion['totals'] > 0) {
if ($post['ctar2'] != 40 && ($post['ctar2'] != 27 || ($post['ctar2'] == 27 && $rivalsGreatConfusion['unique'] > 0))) {
$post['ctar2'] = 99;
//Is the Brewery built?
if($session->tribe != 2 || $database->getFieldLevelInVillage($village->wid, 35) == 0){
if($rivalsGreatConfusion['totals'] > 0) {
if ($post['ctar2'] != 40 && ($post['ctar2'] != 27 || ($post['ctar2'] == 27 && $rivalsGreatConfusion['unique'] > 0))) {
$post['ctar2'] = 99;
}
}
}
else $post['ctar2'] = 99;
}
else $post['ctar2'] = 0;