mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-05 04:14:22 +00:00
catching up (#3)
* fix: all languages added to installer * fix: all languages added to installer and Admin * fix: max crop/resources reset to level 1 value temporarily This happened when level 1 granary / warehouse was built because of a missing + sign in a formula. #374 * chore: some more badges and thanks to JetBrains :) * chore: one more badge :P * chore: cleanup * fix: Multihunter should have access to villages info * fix: troops duplicate for certain tribes via raid lists * fix: no need for WW Building Plan to start building a WW #337 * fix: natar WW villages created without units #392 * fix: sendunits.txt file could not be opened from Admin * fix: WW villages created via Admin do not have any units #392 * fix: WW building plans must be in player's village to start building WW #337
This commit is contained in:
+10
-3
@@ -87,19 +87,22 @@ class Building {
|
||||
|
||||
// check if we should allow building the WW this high
|
||||
if ( $wwHighestLevelFound >= 50 ) {
|
||||
$needed_plan = 1;
|
||||
$needed_plan = 2;
|
||||
} else {
|
||||
$needed_plan = 0;
|
||||
$needed_plan = 1;
|
||||
}
|
||||
|
||||
// count building plans
|
||||
if ( $needed_plan ) {
|
||||
$wwbuildingplan = 0;
|
||||
$planFoundInOwnersVillage = false;
|
||||
$villages = $database->getVillagesID( $session->uid );
|
||||
|
||||
foreach ( $villages as $village1 ) {
|
||||
$plan = count( $database->getOwnArtefactInfoByType2( $village1, 11 ) );
|
||||
if ( $plan > 0 ) {
|
||||
$wwbuildingplan = 1;
|
||||
$planFoundInOwnersVillage = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +121,11 @@ class Building {
|
||||
}
|
||||
}
|
||||
|
||||
$cached = $wwbuildingplan > $needed_plan;
|
||||
if ($needed_plan == 1) {
|
||||
$cached = ($wwbuildingplan >= $needed_plan && $planFoundInOwnersVillage);
|
||||
} else {
|
||||
$cached = $wwbuildingplan >= $needed_plan;
|
||||
}
|
||||
} else {
|
||||
// no need for building plans, we can still upgrade WW
|
||||
$cached = true;
|
||||
|
||||
Reference in New Issue
Block a user