mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-01 16:17:13 +00:00
Fixed an oasis exploit
With this bug you could have an infinite amount of resources
This commit is contained in:
@@ -2126,17 +2126,20 @@ class Automation {
|
|||||||
}else{
|
}else{
|
||||||
$cranny_eff = 0;
|
$cranny_eff = 0;
|
||||||
|
|
||||||
// work out available resources.
|
|
||||||
$this->updateORes($data['to']);
|
|
||||||
$this->pruneOResource();
|
|
||||||
|
|
||||||
if ($conqureby >0) { //10% from owner proc village owner - fix by ronix
|
if ($conqureby >0) { //10% from owner proc village owner - fix by ronix
|
||||||
|
$this->updateRes($conqureby,$to['owner']);
|
||||||
|
$this->pruneResource();
|
||||||
|
|
||||||
$villageData = $database->getVillageFields($conqureby,'clay, iron, wood, crop');
|
$villageData = $database->getVillageFields($conqureby,'clay, iron, wood, crop');
|
||||||
$totclay = intval($villageData['clay']/10);
|
$totclay = intval($villageData['clay']/10);
|
||||||
$totiron = intval($villageData['iron']/10);
|
$totiron = intval($villageData['iron']/10);
|
||||||
$totwood = intval($villageData['wood']/10);
|
$totwood = intval($villageData['wood']/10);
|
||||||
$totcrop = intval($villageData['crop']/10);
|
$totcrop = intval($villageData['crop']/10);
|
||||||
}else{
|
}else{
|
||||||
|
// work out available resources.
|
||||||
|
$this->updateORes($data['to']);
|
||||||
|
$this->pruneOResource();
|
||||||
|
|
||||||
$oasisData = $database->getOasisFields($data['to'],'clay, iron, wood, crop');
|
$oasisData = $database->getOasisFields($data['to'],'clay, iron, wood, crop');
|
||||||
$totclay = $oasisData['clay'];
|
$totclay = $oasisData['clay'];
|
||||||
$totiron = $oasisData['iron'];
|
$totiron = $oasisData['iron'];
|
||||||
@@ -3014,7 +3017,12 @@ class Automation {
|
|||||||
if ($isoasis == 0){
|
if ($isoasis == 0){
|
||||||
$database->modifyResource($DefenderWref,$steal[0],$steal[1],$steal[2],$steal[3],0);
|
$database->modifyResource($DefenderWref,$steal[0],$steal[1],$steal[2],$steal[3],0);
|
||||||
}else{
|
}else{
|
||||||
$database->modifyOasisResource($DefenderWref,$steal[0],$steal[1],$steal[2],$steal[3],0);
|
if($conqureby > 0) //if it's an oasis but it's conquered by someone, resources must be modified in the owner village
|
||||||
|
{
|
||||||
|
$database->modifyResource($conqureby,$steal[0],$steal[1],$steal[2],$steal[3],0);
|
||||||
|
}else{
|
||||||
|
$database->modifyOasisResource($DefenderWref,$steal[0],$steal[1],$steal[2],$steal[3],0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$database->addMovement(6,$DefenderWref,$AttackerWref,$reference,$AttackArrivalTime,$endtime,1,0,0,0,0,$data['ref']);
|
$database->addMovement(6,$DefenderWref,$AttackerWref,$reference,$AttackArrivalTime,$endtime,1,0,0,0,0,$data['ref']);
|
||||||
$totalstolengain=$steal[0]+$steal[1]+$steal[2]+$steal[3];
|
$totalstolengain=$steal[0]+$steal[1]+$steal[2]+$steal[3];
|
||||||
|
|||||||
Reference in New Issue
Block a user