General fixes

+A method in Building.php is now static
+Fixed timers in the market
+Fixed a bug that did take in account a wrong tournament square when
calculating the returning time of the troops
This commit is contained in:
iopietro
2018-05-10 20:50:29 +02:00
parent de74f4a0cb
commit 950fc61f8a
10 changed files with 67 additions and 94 deletions
+4 -3
View File
@@ -35,8 +35,9 @@ class MyGenerator {
return substr($encode,0,$length);
}
public function procDistanceTime($coor, $thiscoor, $ref, $mode) {
public function procDistanceTime($coor, $thiscoor, $ref, $mode, $vid = 0) {
global $bid28, $bid14, $building;
$xdistance = ABS($thiscoor['x'] - $coor['x']);
if($xdistance > WORLD_MAX) {
$xdistance = (2 * WORLD_MAX + 1) - $xdistance;
@@ -54,8 +55,8 @@ class MyGenerator {
else $speed = 1;
}else{
$speed = $ref;
if($building->getTypeLevel(14) != 0 && $distance >= TS_THRESHOLD) {
$speed *= ($bid14[$building->gettypeLevel(14)]['attri'] / 100) ;
if(($tSquareLevel = $building->getTypeLevel(14, $vid)) > 0 && $distance >= TS_THRESHOLD) {
$speed *= ($bid14[$tSquareLevel]['attri'] / 100) ;
}
}