mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-26 21:27:15 +00:00
Update Village.php
This commit is contained in:
+16
-9
@@ -28,15 +28,22 @@ class Village {
|
|||||||
private $production = array();
|
private $production = array();
|
||||||
private $oasisowned,$ocounter = array();
|
private $oasisowned,$ocounter = array();
|
||||||
|
|
||||||
function Village() {
|
function Village() {
|
||||||
global $session;
|
global $session, $database;
|
||||||
if(isset($_SESSION['wid'])) {
|
if(isset($_SESSION['wid'])) {
|
||||||
$this->wid = $_SESSION['wid'];
|
$this->wid = $_SESSION['wid'];
|
||||||
}
|
|
||||||
else {
|
}
|
||||||
$this->wid = $session->villages[0];
|
else {
|
||||||
}
|
$this->wid = $session->villages[0];
|
||||||
$this->LoadTown();
|
}
|
||||||
|
//add new line code
|
||||||
|
//check exist village if from village destroy to avoid error msg.
|
||||||
|
if (!$database-> checkVilExist($this->wid)) {
|
||||||
|
$this->wid=$database->getVillageID($session->uid);
|
||||||
|
$_SESSION['wid']=$this->wid;
|
||||||
|
}
|
||||||
|
$this->LoadTown();
|
||||||
$this->calculateProduction();
|
$this->calculateProduction();
|
||||||
$this->processProduction();
|
$this->processProduction();
|
||||||
$this->ActionControl();
|
$this->ActionControl();
|
||||||
|
|||||||
Reference in New Issue
Block a user