mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-30 15:17:13 +00:00
Fixed a bug while finishing a construction
+Buildings cannot be incremented anymore by two levels instead of one
This commit is contained in:
@@ -584,7 +584,7 @@ class Automation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function buildComplete() {
|
private function buildComplete() {
|
||||||
global $database,$bid18,$bid10,$bid11,$bid38,$bid39;
|
global $database, $bid18, $bid10, $bid11, $bid38, $bid39;
|
||||||
|
|
||||||
if(file_exists("GameEngine/Prevention/build.txt")) {
|
if(file_exists("GameEngine/Prevention/build.txt")) {
|
||||||
unlink("GameEngine/Prevention/build.txt");
|
unlink("GameEngine/Prevention/build.txt");
|
||||||
@@ -624,15 +624,9 @@ class Automation {
|
|||||||
$villageData = $database->getVillageFields($indi['wid'],'owner, maxcrop, maxstore, starv, pop');
|
$villageData = $database->getVillageFields($indi['wid'],'owner, maxcrop, maxstore, starv, pop');
|
||||||
$villageOwner = $villageData['owner'];
|
$villageOwner = $villageData['owner'];
|
||||||
$villagesAffected[] = (int) $indi['wid'];
|
$villagesAffected[] = (int) $indi['wid'];
|
||||||
$level = $database->getFieldLevel($indi['wid'],$indi['field']);
|
|
||||||
$fieldsToSet = [];
|
$fieldsToSet = [];
|
||||||
|
|
||||||
if (($level + 1) == $indi['level']){
|
$q = "UPDATE ".TB_PREFIX."fdata SET f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." WHERE vref = ".(int) $indi['wid'];
|
||||||
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." where vref = ".(int) $indi['wid'];
|
|
||||||
} else {
|
|
||||||
$indi['level'] = ($level + 1);
|
|
||||||
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." where vref = ".(int) $indi['wid'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($database->query($q)) {
|
if($database->query($q)) {
|
||||||
// this will be the level we brought the building to now
|
// this will be the level we brought the building to now
|
||||||
|
|||||||
Reference in New Issue
Block a user