mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-20 10:11:00 +00:00
improve market at least
This commit is contained in:
@@ -594,6 +594,8 @@
|
|||||||
return $dbarray['fieldtype'];
|
return $dbarray['fieldtype'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************
|
/*****************************************
|
||||||
Function to retrieve if is ocuped via ID
|
Function to retrieve if is ocuped via ID
|
||||||
References: Village ID
|
References: Village ID
|
||||||
@@ -1543,7 +1545,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getVillageByName($name) {
|
function getVillageByName($name) {
|
||||||
$name = mysql_real_escape_string($name, $this->connection);
|
|
||||||
$q = "SELECT wref FROM " . TB_PREFIX . "vdata where name = '$name' limit 1";
|
$q = "SELECT wref FROM " . TB_PREFIX . "vdata where name = '$name' limit 1";
|
||||||
$result = mysql_query($q, $this->connection);
|
$result = mysql_query($q, $this->connection);
|
||||||
$dbarray = mysql_fetch_array($result);
|
$dbarray = mysql_fetch_array($result);
|
||||||
|
|||||||
@@ -105,10 +105,13 @@ class Market {
|
|||||||
}
|
}
|
||||||
if($database->getVillageState($id)) {
|
if($database->getVillageState($id)) {
|
||||||
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
|
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
|
||||||
|
$res = $resource[0]+$resource[1]+$resource[2]+$resource[3];
|
||||||
|
if($res!=0){
|
||||||
$reference = $database->sendResource($resource[0],$resource[1],$resource[2],$resource[3],$reqMerc,0);
|
$reference = $database->sendResource($resource[0],$resource[1],$resource[2],$resource[3],$reqMerc,0);
|
||||||
$database->modifyResource($village->wid,$resource[0],$resource[1],$resource[2],$resource[3],0);
|
$database->modifyResource($village->wid,$resource[0],$resource[1],$resource[2],$resource[3],0);
|
||||||
$database->addMovement(0,$village->wid,$id,$reference,time(),time()+$timetaken);
|
$database->addMovement(0,$village->wid,$id,$reference,time(),time()+$timetaken);
|
||||||
$logging->addMarketLog($village->wid,1,array($resource[0],$resource[1],$resource[2],$resource[3],$id));
|
$logging->addMarketLog($village->wid,1,array($resource[0],$resource[1],$resource[2],$resource[3],$id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
header("Location: build.php?id=".$post['id']);
|
header("Location: build.php?id=".$post['id']);
|
||||||
|
|||||||
Reference in New Issue
Block a user