Fixed some bugs and errors

+Part 1 of the starvation refactor, attacking troops will now be killed
+Fixed some errors in Units.php, Technology.php, Battle.php and some
16_incomming.tpl
-Removed an unused function in Database.php
+Fixed a bug that could have destroyed a village after taking an
artefact even if it had more than 0 pop
This commit is contained in:
iopietro
2018-04-09 21:31:50 +02:00
parent bdca64eed3
commit 21179d346f
6 changed files with 149 additions and 149 deletions
+5 -9
View File
@@ -239,7 +239,7 @@ class Units {
public function returnTroops($wref,$mode=0) {
global $database;
if (!mode) {
if (!$mode) {
$getenforce=$database->getEnforceVillage($wref,0);
foreach($getenforce as $enforce) {
$this->processReturnTroops($enforce);
@@ -414,14 +414,10 @@ class Units {
array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
);
$data21 = $database->getUserField( $database->getVrefField( $village->wid, 'owner' )['owner'], 'tribe', 0 );
$eigen = $database->getCoor( $village->wid );
$from = array( 'x' => $eigen['x'], 'y' => $eigen['y'] );
$ander = $database->getCoor( $data['to_vid'] );
$to = array( 'x' => $ander['x'], 'y' => $ander['y'] );
$start = ( $data21['tribe'] - 1 ) * 10 + 1;
$end = ( $data21['tribe'] * 10 );
$fromcoor = $database->getCoor( $village->wid );
$from = array('x' => $fromcoor['x'], 'y' => $fromcoor['y']);
$tocoor = $database->getCoor( $data['to_vid'] );
$to = array('x' => $tocoor['x'], 'y' => $tocoor['y']);
$speeds = array();
$scout = 1;