mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-15 17:16:08 +00:00
General fixes
+Fixed an exploit that permit to maintain the crop level constant if the page was refreshed every second, with a negative production
This commit is contained in:
@@ -3974,7 +3974,6 @@ class Automation {
|
||||
$unitArrays = $this->getAllUnits($wref, false);
|
||||
$villageUpkeep = $getVillage['pop'] + $technology->getUpkeep($unitArrays, 0, $wref);
|
||||
$starv = $getVillage['starv'];
|
||||
|
||||
if ($crop < $villageUpkeep){
|
||||
//Add starvation data
|
||||
$database->setVillageFields($wref, ['starv', 'starvupdate'], [$villageUpkeep, time()]);
|
||||
@@ -4156,7 +4155,7 @@ class Automation {
|
||||
break;
|
||||
}
|
||||
|
||||
$database->modifyResource($starv['wref'], 0, 0, 0, max(intval($newCrop), 0), 1);
|
||||
$database->modifyResource($starv['wref'], 0, 0, 0, max($newCrop, 0), 1);
|
||||
$database->setVillageField($starv['wref'], ['starv', 'starvupdate'], [$upkeep, $time]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user