mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-11 07:06:06 +00:00
Distance calculation optimization and bug fixing
-Removed a lot of redundant code and put into a function +Fixed a bug that permitted to found a new village in already founded village +Fixed a bug that permitted to found in an oasis +Fixed a bug that permitted to hack the time you need to found a new village +Fixed a bug that permitted to found a new village to an inexistent one
This commit is contained in:
@@ -123,7 +123,7 @@ class Market
|
||||
$coor = $database->getCoor($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)
|
||||
{
|
||||
@@ -308,7 +308,7 @@ class Market
|
||||
foreach($displayarray as $value)
|
||||
{
|
||||
$targetcoor = $database->getCoor($value['vref']);
|
||||
$duration = $generator->procDistanceTime($targetcoor,$village->coor,$session->tribe,0);
|
||||
$duration = $generator->procDistanceTime($targetcoor, $village->coor, $session->tribe, 0);
|
||||
if($duration <= ($value['maxtime'] * 3600) || $value['maxtime'] == 0)
|
||||
{
|
||||
$value['duration'] = $duration;
|
||||
|
||||
Reference in New Issue
Block a user