mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-19 08:37:18 +00:00
Fix Huns Loiality Regeneration & WW cannot be change to capital
Fix Huns Loiality Regeneration & WW cannot be change to capital
This commit is contained in:
+19
-1
@@ -24,7 +24,19 @@ if(time() - (!empty($_SESSION['time_p']) ? $_SESSION['time_p'] : 0) > 5){
|
||||
$_SESSION['error_p'] = '';
|
||||
}
|
||||
// --- CHANGE CAPITAL LOGIC ---
|
||||
if($_POST && $_GET['action'] == 'change_capital' && !$village->capital){
|
||||
/**
|
||||
* Satul Minunii Lumii NU poate deveni capitala.
|
||||
*
|
||||
* Capitala are reguli proprii - campurile de resurse urca peste 10, primeste
|
||||
* Atelierul Pietrarului, iar cladirile capital-only se sterg la mutare. Un sat
|
||||
* de Minune cucerit de la Natari nu suporta asta.
|
||||
*
|
||||
* Blocam si actiunea, nu doar butonul: altfel cererea putea fi trimisa direct.
|
||||
*/
|
||||
$isWonderVillage = isset($village->resarray['f99t'])
|
||||
&& (int) $village->resarray['f99t'] == 40;
|
||||
|
||||
if($_POST && $_GET['action'] == 'change_capital' && !$village->capital && !$isWonderVillage){
|
||||
$pass = $_POST['pass'];
|
||||
$query = mysqli_query($database->dblink, 'SELECT password FROM `'.TB_PREFIX.'users` WHERE `id` = '.(int)$session->uid);
|
||||
$data = mysqli_fetch_assoc($query);
|
||||
@@ -99,6 +111,12 @@ if($village->capital == 1) {
|
||||
?>
|
||||
<p class="none"><?php echo CAPITAL; ?></p>
|
||||
<?php
|
||||
} elseif ($isWonderVillage) {
|
||||
// satul Minunii nu poate fi capitala
|
||||
?>
|
||||
<p class="none"><?php echo defined('TZ_WW_NO_CAPITAL') ? TZ_WW_NO_CAPITAL
|
||||
: 'The World Wonder village cannot become your capital.'; ?></p>
|
||||
<?php
|
||||
} else {
|
||||
if(empty($_GET['confirm'])) {
|
||||
print '<p><a href="?id='.$building->getTypeField(26).'&confirm=yes">» '.CHANGE_CAPITAL.'</a></p>';
|
||||
|
||||
Reference in New Issue
Block a user